#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()<<":"
//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);
#include "llvm/ADT/STLExtras.h"
#include <cstdio>
#include <set>
+#include <algorithm>
+
using namespace llvm;
namespace {
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);
}
}
}
// (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.