Add support for a new zeroinitializer token which can be used to get rid of

huge arrays of zero initialized values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-06-28 20:01:34 +00:00
parent 22b1fa0ef2
commit f460048771
2 changed files with 7 additions and 1 deletions

View 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; }

View 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