mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-23 20:57:21 +00:00
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:
parent
22b1fa0ef2
commit
f460048771
@ -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; }
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user