[LLVMbugs] Compiler errors on msvc
Ted Kremenek
kremenek at apple.com
Sun Mar 9 11:34:26 PDT 2008
Applied!
http://llvm.org/viewvc/llvm-project?rev=48115&view=rev
Thanks!
On Mar 9, 2008, at 11:21 AM, Argiris Kirtzidis wrote:
> Hi,
>
> The attached patch fixes a couple of compiler errors on msvc:
>
> - std::map<const Value*,Value*>::const_iterator I =
> ValueMap.find(SAliasee);
> + std::map<const Value*,Value*>::const_iterator VMI =
> ValueMap.find(SAliasee);
>
> error: redefinition of 'I'
>
> +#include <algorithm>
> so that std::find is usable.
>
> <msvc-fix.zip>Index: lib/Linker/LinkModules.cpp
> ===================================================================
> --- lib/Linker/LinkModules.cpp (revision 48113)
> +++ lib/Linker/LinkModules.cpp (working copy)
> @@ -597,9 +597,9 @@
>
> // 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: lib/Transforms/IPO/ExtractGV.cpp
> ===================================================================
> --- lib/Transforms/IPO/ExtractGV.cpp (revision 48113)
> +++ lib/Transforms/IPO/ExtractGV.cpp (working copy)
> @@ -17,6 +17,7 @@
> #include "llvm/Constants.h"
> #include "llvm/Transforms/IPO.h"
> #include "llvm/Support/Compiler.h"
> +#include <algorithm>
> using namespace llvm;
>
> namespace {
> _______________________________________________
> LLVMbugs mailing list
> LLVMbugs at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20080309/730cea04/attachment.html>
More information about the llvm-bugs
mailing list