Fix some compilation errors on msvc:
authorTed Kremenek <kremenek@apple.com>
Sun, 9 Mar 2008 18:32:50 +0000 (18:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 9 Mar 2008 18:32:50 +0000 (18:32 +0000)
- "Redefinition of I" (iterator masks previous definition)
- include missing header file

Patch by Argiris Kirtzidis!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48115 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/Transforms/IPO/ExtractGV.cpp

index 5545af69f16fc80e9c9f012b54c8f1d78e112741..ad6852dce6abc8e693af2cab2bc507f8648223cf 100644 (file)
@@ -597,9 +597,9 @@ static bool LinkAlias(Module *Dest, const Module *Src,
 
     // Globals were already linked, thus we can just query ValueMap for variant
     // of SAliasee in Dest
-    std::map<const Value*,Value*>::const_iterator I = ValueMap.find(SAliasee);
-    assert(I != ValueMap.end() && "Aliasee not linked");
-    GlobalValue* DAliasee = cast<GlobalValue>(I->second);
+    std::map<const Value*,Value*>::const_iterator VMI = ValueMap.find(SAliasee);
+    assert(VMI != ValueMap.end() && "Aliasee not linked");
+    GlobalValue* DAliasee = cast<GlobalValue>(VMI->second);
 
     // Try to find something 'similar' to SGA in destination module.
     if (GlobalAlias *DGA = Dest->getNamedAlias(SGA->getName())) {
index a230dd1db881f96135dde8fc308ae1a2873c5398..882097cae55dca6b9e0c25735f7b2e4b84fce526 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/Constants.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Support/Compiler.h"
+#include <algorithm>
 using namespace llvm;
 
 namespace {