diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ConstantProp.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/DCE.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/ConstantProp.cpp b/llvm/lib/Transforms/Scalar/ConstantProp.cpp index f1f7a442221..8be02476b9c 100644 --- a/llvm/lib/Transforms/Scalar/ConstantProp.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantProp.cpp @@ -49,7 +49,10 @@ Pass *llvm::createConstantPropagationPass() { bool ConstantPropagation::runOnFunction(Function &F) { // Initialize the worklist to all of the instructions ready to process... - std::set<Instruction*> WorkList(inst_begin(F), inst_end(F)); + std::set<Instruction*> WorkList; + for(inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) { + WorkList.insert(&*i); + } bool Changed = false; while (!WorkList.empty()) { diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp index 36e662ac2fb..64dfa8c82ae 100644 --- a/llvm/lib/Transforms/Scalar/DCE.cpp +++ b/llvm/lib/Transforms/Scalar/DCE.cpp @@ -76,7 +76,10 @@ namespace { bool DCE::runOnFunction(Function &F) { // Start out with all of the instructions in the worklist... - std::vector<Instruction*> WorkList(inst_begin(F), inst_end(F)); + std::vector<Instruction*> WorkList; + for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) { + WorkList.push_back(&*i); + } std::set<Instruction*> DeadInsts; // Loop over the worklist finding instructions that are dead. If they are diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index e2607c0c1a8..92b7f1a39bc 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2934,7 +2934,10 @@ bool InstCombiner::runOnFunction(Function &F) { bool Changed = false; TD = &getAnalysis<TargetData>(); - WorkList.insert(WorkList.end(), inst_begin(F), inst_end(F)); + for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) { + WorkList.push_back(&*i); + } + while (!WorkList.empty()) { Instruction *I = WorkList.back(); // Get an instruction from the worklist |