VStudio compiler errors and placing Function*->ExFunc map under ManagedStatic control.
This commit fixes two things. One is a pair of VStudio compiler errors stemming from variables
which defined within the for loop statement and also within the body of the for loop. I fixed these
by renaming one of the two variables. Additionally, I've made the Function*->ExFunc map in
ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown. In repeated
uses of the interpreter, where the same Function* address may get used for completely differnet functions,
this was causing a crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40558 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 5caf01c..3ef6376 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -482,9 +482,9 @@
for (DominanceFrontier::DomSetType::iterator I = S.begin(), E = S.end();
I != E; ++I) {
BasicBlock *BB = *I;
- DenseMap<const Value*, Value*>::iterator I = VM.find(BB);
- if (I != VM.end())
- NewDFSet.insert(cast<BasicBlock>(I->second));
+ DenseMap<const Value*, Value*>::iterator IDM = VM.find(BB);
+ if (IDM != VM.end())
+ NewDFSet.insert(cast<BasicBlock>(IDM->second));
else
NewDFSet.insert(BB);
}