[llvm-commits] [llvm] r63501 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/Assembler/2009-02-01-UnnamedForwardRef.ll

Chris Lattner sabre at nondot.org
Sun Feb 1 23:24:28 PST 2009


Author: lattner
Date: Mon Feb  2 01:24:28 2009
New Revision: 63501

URL: http://llvm.org/viewvc/llvm-project?rev=63501&view=rev
Log:
Fix PR3372

Added:
    llvm/trunk/test/Assembler/2009-02-01-UnnamedForwardRef.ll
Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=63501&r1=63500&r2=63501&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Feb  2 01:24:28 2009
@@ -471,8 +471,9 @@
   GlobalVariable *GV = 0;
 
   // See if the global was forward referenced, if so, use the global.
-  if (!Name.empty() && (GV = M->getGlobalVariable(Name, true))) {
-    if (!ForwardRefVals.erase(Name))
+  if (!Name.empty()) {
+    if ((GV = M->getGlobalVariable(Name, true)) &&
+        !ForwardRefVals.erase(Name))
       return Error(NameLoc, "redefinition of global '@" + Name + "'");
   } else {
     std::map<unsigned, std::pair<GlobalValue*, LocTy> >::iterator

Added: llvm/trunk/test/Assembler/2009-02-01-UnnamedForwardRef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2009-02-01-UnnamedForwardRef.ll?rev=63501&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2009-02-01-UnnamedForwardRef.ll (added)
+++ llvm/trunk/test/Assembler/2009-02-01-UnnamedForwardRef.ll Mon Feb  2 01:24:28 2009
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis
+; PR3372
+
+ at X = global i32* @0
+global i32 4
+





More information about the llvm-commits mailing list