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

Chris Lattner lattner at cs.uiuc.edu
Tue Jul 13 01:39:25 PDT 2004



Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.177 -> 1.178

---
Log message:

Fix typeo and refactor bb productions to make it possible for us to reuse any 
forward reference blocks if they have been created (instead of creating a new
block, replaceAllUsesOfWith, then nuking the placeholder).   This is not yet 
implemented.


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

Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.177 llvm/lib/AsmParser/llvmAsmParser.y:1.178
--- llvm/lib/AsmParser/llvmAsmParser.y:1.177	Tue Jul 13 03:28:21 2004
+++ llvm/lib/AsmParser/llvmAsmParser.y	Tue Jul 13 03:39:15 2004
@@ -71,7 +71,7 @@
 
   /// PlaceHolderInfo - When temporary placeholder objects are created, remember
   /// how they were referenced and one which line of the input they came from so
-  /// that we can resolve them alter and print error messages as appropriate.
+  /// that we can resolve them later and print error messages as appropriate.
   std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
 
   // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
@@ -1639,16 +1639,6 @@
     $1->getInstList().push_back($3);
     InsertValue($1);
     $$ = $1;
-  }
-  | LABELSTR InstructionList OptAssign BBTerminatorInst  {
-    setValueName($4, $3);
-    InsertValue($4);
-
-    $2->getInstList().push_back($4);
-    setValueName($2, $1);
-
-    InsertValue($2);
-    $$ = $2;
   };
 
 InstructionList : InstructionList Inst {
@@ -1656,7 +1646,18 @@
     $$ = $1;
   }
   | /* empty */ {
+    // FIXME: Should check to see if there is a forward ref'd basic block that
+    // we can use and reuse it as appropriate.  It doesn't make sense just to
+    // make forward ref'd blocks then discard them.
+    $$ = CurBB = new BasicBlock("", CurFun.CurrentFunction);
+  }
+  | LABELSTR {
+    // FIXME: Should check to see if there is a forward ref'd basic block that
+    // we can use and reuse it as appropriate.  It doesn't make sense just to
+    // make forward ref'd blocks then discard them.
     $$ = CurBB = new BasicBlock("", CurFun.CurrentFunction);
+    setValueName($$, $1);
+    InsertValue($$);
   };
 
 BBTerminatorInst : RET ResolvedVal {              // Return with a result...





More information about the llvm-commits mailing list