Skip to content

Commit fc83b6f

Browse files
wpangfxbot
authored andcommitted
With gcc4.4, std::list::insert still takes iterator, not const_iterator
Change-Id: Id67a57007d3ba7711f3a7845937e7fe26f1369a9
1 parent 51caaff commit fc83b6f

File tree

1 file changed

+51
-52
lines changed

1 file changed

+51
-52
lines changed

visa/FlowGraph.h

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ class G4_BB
278278
// indicate the nest level of the loop
279279
unsigned char loopNestLevel;
280280

281-
// indicates the scoping info in call graph
282-
unsigned scopeID;
281+
// indicates the scoping info in call graph
282+
unsigned scopeID;
283283

284284
// if the block is under simd flow control
285285
bool inSimdFlow;
@@ -310,20 +310,20 @@ class G4_BB
310310
INST_LIST::reverse_iterator rbegin() { return instList.rbegin(); }
311311
INST_LIST::reverse_iterator rend() { return instList.rend(); }
312312
INST_LIST& getInstList() { return instList; }
313-
INST_LIST_ITER insert(INST_LIST::const_iterator iter, G4_INST* inst)
313+
INST_LIST_ITER insert(INST_LIST::iterator iter, G4_INST* inst)
314314
{
315315
return instList.insert(iter, inst);
316316
}
317317
template <class InputIt>
318-
INST_LIST_ITER insert(INST_LIST::const_iterator iter, InputIt first, InputIt last)
318+
INST_LIST_ITER insert(INST_LIST::iterator iter, InputIt first, InputIt last)
319319
{
320320
return instList.insert(iter, first, last);
321321
}
322-
INST_LIST_ITER erase(INST_LIST::const_iterator iter)
322+
INST_LIST_ITER erase(INST_LIST::iterator iter)
323323
{
324324
return instList.erase(iter);
325325
}
326-
INST_LIST_ITER erase(INST_LIST::const_iterator first, INST_LIST::const_iterator last)
326+
INST_LIST_ITER erase(INST_LIST::iterator first, INST_LIST::iterator last)
327327
{
328328
return instList.erase(first, last);
329329
}
@@ -337,29 +337,29 @@ class G4_BB
337337
bool empty() const { return instList.empty(); }
338338
G4_INST* front() { return instList.front(); }
339339
G4_INST* back() { return instList.back(); }
340-
void splice(INST_LIST::const_iterator pos, INST_LIST& other)
340+
void splice(INST_LIST::iterator pos, INST_LIST& other)
341341
{
342342
instList.splice(pos, other);
343343
}
344-
void splice(INST_LIST::const_iterator pos, G4_BB* otherBB)
344+
void splice(INST_LIST::iterator pos, G4_BB* otherBB)
345345
{
346346
instList.splice(pos, otherBB->getInstList());
347347
}
348-
void splice(INST_LIST::const_iterator pos, INST_LIST& other, INST_LIST::const_iterator it)
348+
void splice(INST_LIST::iterator pos, INST_LIST& other, INST_LIST::iterator it)
349349
{
350350
instList.splice(pos, other, it);
351351
}
352-
void splice(INST_LIST::const_iterator pos, G4_BB* otherBB, INST_LIST::const_iterator it)
352+
void splice(INST_LIST::iterator pos, G4_BB* otherBB, INST_LIST::iterator it)
353353
{
354354
instList.splice(pos, otherBB->getInstList(), it);
355355
}
356-
void splice(INST_LIST::const_iterator pos, INST_LIST& other,
357-
INST_LIST::const_iterator first, INST_LIST::const_iterator last)
356+
void splice(INST_LIST::iterator pos, INST_LIST& other,
357+
INST_LIST::iterator first, INST_LIST::iterator last)
358358
{
359359
instList.splice(pos, other, first, last);
360360
}
361-
void splice(INST_LIST::const_iterator pos, G4_BB* otherBB,
362-
INST_LIST::const_iterator first, INST_LIST::const_iterator last)
361+
void splice(INST_LIST::iterator pos, G4_BB* otherBB,
362+
INST_LIST::iterator first, INST_LIST::iterator last)
363363
{
364364
instList.splice(pos, otherBB->getInstList(), first, last);
365365
}
@@ -435,8 +435,8 @@ class G4_BB
435435
void resetNestLevel() { loopNestLevel = 0; }
436436
void setInSimdFlow(bool val) {inSimdFlow = val;}
437437
bool isInSimdFlow() {return inSimdFlow;}
438-
unsigned getScopeID() { return scopeID; }
439-
void setScopeID(unsigned id) { scopeID = id; }
438+
unsigned getScopeID() { return scopeID; }
439+
void setScopeID(unsigned id) { scopeID = id; }
440440

441441
G4_BB* getPhysicalPred() const { return physicalPred; }
442442
G4_BB* getPhysicalSucc() const { return physicalSucc; }
@@ -489,7 +489,7 @@ class G4_BB
489489
return firstInst;
490490
}
491491

492-
void addEOTSend(G4_INST* lastInst = NULL);
492+
void addEOTSend(G4_INST* lastInst = NULL);
493493

494494
/// Dump instructions into the standard error.
495495
void dump(bool printCFG) const;
@@ -706,10 +706,10 @@ class FlowGraph
706706

707707
std::vector<FuncInfo*> funcInfoTable; // the vector of function info nodes. entry function is not included.
708708

709-
std::vector<FuncInfo*> sortedFuncTable; // subroutines in reverse topographical order (leaf at top)
709+
std::vector<FuncInfo*> sortedFuncTable; // subroutines in reverse topographical order (leaf at top)
710710
// kernelInfo is the last element with invalid func id
711711

712-
FuncInfo* kernelInfo; // the call info for the kernel function
712+
FuncInfo* kernelInfo; // the call info for the kernel function
713713

714714
IR_Builder *builder; // needed to create new instructions (mainly labels)
715715
GlobalOpndHashTable globalOpndHT;
@@ -718,10 +718,10 @@ class FlowGraph
718718
G4_Declare * stackPtrDcl;
719719
G4_Declare * scratchRegDcl;
720720
// ToDo: change to set if we have a lot of stack call sites
721-
std::vector<G4_Declare *> pseudoVCADclList;
721+
std::vector<G4_Declare *> pseudoVCADclList;
722722
G4_Declare * pseudoVCEDcl;
723-
std::vector<G4_Declare*> pseudoA0DclList;
724-
std::vector<G4_Declare*> pseudoFlagDclList;
723+
std::vector<G4_Declare*> pseudoA0DclList;
724+
std::vector<G4_Declare*> pseudoFlagDclList;
725725

726726
unsigned callerSaveAreaOffset;
727727
unsigned calleeSaveAreaOffset;
@@ -1011,12 +1011,12 @@ class FlowGraph
10111011

10121012
void findNaturalLoops();
10131013

1014-
void traverseFunc(FuncInfo* func, unsigned int *ptr);
1015-
void topologicalSortCallGraph();
1016-
void findDominators(std::map<FuncInfo*, std::set<FuncInfo*>>& domMap);
1017-
unsigned int resolveVarScope(G4_Declare* dcl, FuncInfo* func);
1018-
void markVarScope(std::vector<G4_BB*>& BBList, FuncInfo* func);
1019-
void markScope();
1014+
void traverseFunc(FuncInfo* func, unsigned int *ptr);
1015+
void topologicalSortCallGraph();
1016+
void findDominators(std::map<FuncInfo*, std::set<FuncInfo*>>& domMap);
1017+
unsigned int resolveVarScope(G4_Declare* dcl, FuncInfo* func);
1018+
void markVarScope(std::vector<G4_BB*>& BBList, FuncInfo* func);
1019+
void markScope();
10201020

10211021
void addSIMDEdges();
10221022

@@ -1080,28 +1080,28 @@ class FlowGraph
10801080
};
10811081

10821082
}
1083-
#define RA_TYPE(DO) \
1084-
DO(TRIVIAL_BC_RA) \
1085-
DO(TRIVIAL_RA) \
1086-
DO(LOCAL_ROUND_ROBIN_BC_RA) \
1087-
DO(LOCAL_ROUND_ROBIN_RA) \
1088-
DO(LOCAL_FIRST_FIT_BC_RA) \
1089-
DO(LOCAL_FIRST_FIT_RA) \
1090-
DO(HYBRID_BC_RA) \
1091-
DO(HYBRID_RA) \
1092-
DO(GRAPH_COLORING_RR_BC_RA) \
1093-
DO(GRAPH_COLORING_FF_BC_RA) \
1094-
DO(GRAPH_COLORING_RR_RA) \
1095-
DO(GRAPH_COLORING_FF_RA) \
1096-
DO(GRAPH_COLORING_SPILL_RR_BC_RA) \
1097-
DO(GRAPH_COLORING_SPILL_FF_BC_RA) \
1098-
DO(GRAPH_COLORING_SPILL_RR_RA) \
1099-
DO(GRAPH_COLORING_SPILL_FF_RA) \
1100-
DO(UNKNOWN_RA)
1083+
#define RA_TYPE(DO) \
1084+
DO(TRIVIAL_BC_RA) \
1085+
DO(TRIVIAL_RA) \
1086+
DO(LOCAL_ROUND_ROBIN_BC_RA) \
1087+
DO(LOCAL_ROUND_ROBIN_RA) \
1088+
DO(LOCAL_FIRST_FIT_BC_RA) \
1089+
DO(LOCAL_FIRST_FIT_RA) \
1090+
DO(HYBRID_BC_RA) \
1091+
DO(HYBRID_RA) \
1092+
DO(GRAPH_COLORING_RR_BC_RA) \
1093+
DO(GRAPH_COLORING_FF_BC_RA) \
1094+
DO(GRAPH_COLORING_RR_RA) \
1095+
DO(GRAPH_COLORING_FF_RA) \
1096+
DO(GRAPH_COLORING_SPILL_RR_BC_RA) \
1097+
DO(GRAPH_COLORING_SPILL_FF_BC_RA) \
1098+
DO(GRAPH_COLORING_SPILL_RR_RA) \
1099+
DO(GRAPH_COLORING_SPILL_FF_RA) \
1100+
DO(UNKNOWN_RA)
11011101

11021102
enum RA_Type
11031103
{
1104-
RA_TYPE(MAKE_ENUM)
1104+
RA_TYPE(MAKE_ENUM)
11051105
};
11061106

11071107
namespace vISA
@@ -1253,7 +1253,7 @@ class G4_Kernel
12531253
bool hasAddrTaken;
12541254
Options *m_options;
12551255

1256-
RA_Type RAType;
1256+
RA_Type RAType;
12571257
KernelDebugInfo* kernelDbgInfo;
12581258
void dumpDotFileInternal(const char* appendix);
12591259
void dumpPassInternal(const char *appendix);
@@ -1421,16 +1421,15 @@ class G4_Kernel
14211421
/// Dump this kernel into the standard error.
14221422
void dump() const;
14231423

1424-
void setRAType(RA_Type type) { RAType = type; }
1425-
RA_Type getRAType() { return RAType; }
1424+
void setRAType(RA_Type type) { RAType = type; }
1425+
RA_Type getRAType() { return RAType; }
14261426

14271427
void setKernelDebugInfo(KernelDebugInfo* k) { kernelDbgInfo = k; }
14281428
KernelDebugInfo* getKernelDebugInfo();
14291429

14301430
bool hasGTPinInit()
14311431
{
1432-
return gtPinInfo &&
1433-
gtPinInfo->getGTPinInit();
1432+
return gtPinInfo && gtPinInfo->getGTPinInit();
14341433
}
14351434

14361435
gtPinData* getGTPinData()

0 commit comments

Comments
 (0)