summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/DCE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DCE.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/DCE.cpp5
1 files changed, 4 insertions, 1 deletions
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
OpenPOWER on IntegriCloud