Add support for a new zeroinitializer token which can be used to get rid of
authorChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 20:01:34 +0000 (20:01 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 20:01:34 +0000 (20:01 +0000)
huge arrays of zero initialized values

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

lib/AsmParser/Lexer.l
lib/AsmParser/llvmAsmParser.y

index 7a56fcc8964b44158170281947cb0b03694b415c..e124d24c1415ba942e982e223727dfc1e715985e 100644 (file)
@@ -174,6 +174,7 @@ appending       { return APPENDING; }
 uninitialized   { return EXTERNAL; }    /* Deprecated, turn into external */
 external        { return EXTERNAL; }
 implementation  { return IMPLEMENTATION; }
+zeroinitializer { return ZEROINITIALIZER; }
 \.\.\.          { return DOTDOTDOT; }
 null            { return NULL_TOK; }
 to              { return TO; }
index ca5b48d01fb35452121b6466afe3f1d0e8e9e61e..233d9ea6baa3412a84af429b35c949a8bb08f0b5 100644 (file)
@@ -702,7 +702,8 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
 %type  <StrVal>  OptVAR_ID OptAssign FuncName
 
 
-%token IMPLEMENTATION TRUE FALSE BEGINTOK ENDTOK DECLARE GLOBAL CONSTANT
+%token IMPLEMENTATION ZEROINITIALIZER TRUE FALSE BEGINTOK ENDTOK
+%token  DECLARE GLOBAL CONSTANT
 %token TO EXCEPT DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE APPENDING
 %token OPAQUE NOT EXTERNAL TARGET ENDIAN POINTERSIZE LITTLE BIG
 
@@ -1039,6 +1040,10 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
       ThrowException("Mismatched types for constant expression!");
     $$ = $2;
     delete $1;
+  }
+  | Types ZEROINITIALIZER {
+    $$ = Constant::getNullValue($1->get());
+    delete $1;
   };
 
 ConstVal : SIntType EINT64VAL {      // integral constants