[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Sat Jun 28 15:02:01 PDT 2003
Changes in directory llvm/lib/AsmParser:
Lexer.l updated: 1.34 -> 1.35
llvmAsmParser.y updated: 1.114 -> 1.115
---
Log message:
Add support for a new zeroinitializer token which can be used to get rid of
huge arrays of zero initialized values
---
Diffs of the changes:
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.34 llvm/lib/AsmParser/Lexer.l:1.35
--- llvm/lib/AsmParser/Lexer.l:1.34 Wed May 7 21:44:01 2003
+++ llvm/lib/AsmParser/Lexer.l Sat Jun 28 15:01:34 2003
@@ -174,6 +174,7 @@
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: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.114 llvm/lib/AsmParser/llvmAsmParser.y:1.115
--- llvm/lib/AsmParser/llvmAsmParser.y:1.114 Wed Jun 18 14:22:32 2003
+++ llvm/lib/AsmParser/llvmAsmParser.y Sat Jun 28 15:01:34 2003
@@ -702,7 +702,8 @@
%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
@@ -1038,6 +1039,10 @@
if ($1->get() != $2->getType())
ThrowException("Mismatched types for constant expression!");
$$ = $2;
+ delete $1;
+ }
+ | Types ZEROINITIALIZER {
+ $$ = Constant::getNullValue($1->get());
delete $1;
};
More information about the llvm-commits
mailing list