[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 25 18:40:30 PDT 2004



Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.194 -> 1.195

---
Log message:

Fix bug in previous patch :(


---
Diffs of the changes:  (+12 -6)

Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.194 llvm/lib/AsmParser/llvmAsmParser.y:1.195
--- llvm/lib/AsmParser/llvmAsmParser.y:1.194	Sun Jul 25 20:22:59 2004
+++ llvm/lib/AsmParser/llvmAsmParser.y	Sun Jul 25 20:40:20 2004
@@ -383,12 +383,6 @@
       ThrowException("Redefinition of label " + ID.getName());
 
     ID.destroy();                       // Free strdup'd memory.
-
-    // Make sure to move the basic block to the correct location in the
-    // function, instead of leaving it inserted wherever it was first
-    // referenced.
-    CurFun.CurrentFunction->getBasicBlockList().remove(BB);
-    CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
     return BB;
   }
 
@@ -1685,9 +1679,21 @@
   }
   | /* empty */ {
     $$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
+
+    // Make sure to move the basic block to the correct location in the
+    // function, instead of leaving it inserted wherever it was first
+    // referenced.
+    CurFun.CurrentFunction->getBasicBlockList().remove(CurBB);
+    CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB);
   }
   | LABELSTR {
     $$ = CurBB = getBBVal(ValID::create($1), true);
+
+    // Make sure to move the basic block to the correct location in the
+    // function, instead of leaving it inserted wherever it was first
+    // referenced.
+    CurFun.CurrentFunction->getBasicBlockList().remove(CurBB);
+    CurFun.CurrentFunction->getBasicBlockList().push_back(CurBB);
   };
 
 BBTerminatorInst : RET ResolvedVal {              // Return with a result...





More information about the llvm-commits mailing list