summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index e2607c0c1a..92b7f1a39b 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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