Correction to allow compilation with Visual C++.
authorReid Spencer <rspencer@reidspencer.com>
Mon, 18 Oct 2004 14:38:48 +0000 (14:38 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 18 Oct 2004 14:38:48 +0000 (14:38 +0000)
Patch contributed by Morten Ofstad. Thanks Morten!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17123 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp
lib/Transforms/Scalar/LoopUnroll.cpp
lib/Transforms/Scalar/LowerGC.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index 10ef440b4f8a7b69412d6d71021c38d728efdff7..bd1fa51621ecd0eb490b4662d53d49198ad1debb 100644 (file)
@@ -638,7 +638,7 @@ void processGraph(Graph &g,
 #ifdef DEBUG_PATH_PROFILES
   //debugging info
   cerr<<"After moving dummy code\n";
-  for(map<Edge, getEdgeCode *>::iterator cd_i=codeInsertions.begin(), 
+  for(map<Edge, getEdgeCode *,EdgeCompare2>::iterator cd_i=codeInsertions.begin(), 
        cd_e=codeInsertions.end(); cd_i != cd_e; ++cd_i){
     printEdge(cd_i->first);
     cerr<<cd_i->second->getCond()<<":"
@@ -650,7 +650,7 @@ void processGraph(Graph &g,
 
   //see what it looks like...
   //now insert code along edges which have codes on them
-  for(map<Edge, getEdgeCode *>::iterator MI=codeInsertions.begin(), 
+  for(map<Edge, getEdgeCode *,EdgeCompare2>::iterator MI=codeInsertions.begin(), 
        ME=codeInsertions.end(); MI!=ME; ++MI){
     Edge ed=MI->first;
     insertBB(ed, MI->second, rInst, countInst, numPaths, MethNo, threshold);
index 17fc35d6a328667a8abf149b0c051700f76e316c..f87b2cae93310f2157b3bf5a1654303e8f206008 100644 (file)
@@ -30,6 +30,8 @@
 #include "llvm/ADT/STLExtras.h"
 #include <cstdio>
 #include <set>
+#include <algorithm>
+
 using namespace llvm;
 
 namespace {
index 2e03807ed2434930b20128ca2353f3b99368d7f5..ee31688f94631ee676b5ae151fe6f70d21b708e1 100644 (file)
@@ -143,8 +143,8 @@ static void Coerce(Instruction *I, unsigned OpNum, Type *Ty) {
     if (Constant *C = dyn_cast<Constant>(I->getOperand(OpNum))) 
       I->setOperand(OpNum, ConstantExpr::getCast(C, Ty));
     else {
-      CastInst *C = new CastInst(I->getOperand(OpNum), Ty, "", I);
-      I->setOperand(OpNum, C);
+      CastInst *CI = new CastInst(I->getOperand(OpNum), Ty, "", I);
+      I->setOperand(OpNum, CI);
     }
   }
 }
index 3311bd1c20bf78e32fdb2d769b1a3f17dbfd062a..213b3d742f4d2d79bf2a4a428d5aa75dab5e6782 100644 (file)
@@ -220,8 +220,8 @@ void PromoteMem2Reg::run() {
         // (unspecified) ordering of basic blocks in the dominance frontier,
         // which would give PHI nodes non-determinstic subscripts.  Fix this by
         // processing blocks in order of the occurance in the function.
-        for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end();
-             P != PE; ++P)
+        for (DominanceFrontier::DomSetType::const_iterator P = S.begin(),
+             PE = S.end(); P != PE; ++P)
           DFBlocks.push_back(BBNumbers.getNumber(*P));
 
         // Sort by which the block ordering in the function.