The parser now accepts "external" global variables, in addition to the backwards

compatible "uninitialized" global variables

llvm-svn: 4050
This commit is contained in:
Chris Lattner 2002-10-06 22:45:09 +00:00
parent 24e01d2066
commit 6408586b7b
2 changed files with 5 additions and 4 deletions

View File

@ -155,7 +155,8 @@ global { return GLOBAL; }
constant { return CONSTANT; }
const { return CONST; }
internal { return INTERNAL; }
uninitialized { return UNINIT; }
uninitialized { return EXTERNAL; } /* Deprecated, turn into external */
external { return EXTERNAL; }
implementation { return IMPLEMENTATION; }
\.\.\. { return DOTDOTDOT; }
null { return NULL_TOK; }

View File

@ -679,8 +679,8 @@ Module *RunVMAsmParser(const string &Filename, FILE *F) {
%type <StrVal> OptVAR_ID OptAssign FuncName
%token IMPLEMENTATION TRUE FALSE BEGINTOK ENDTOK DECLARE GLOBAL CONSTANT UNINIT
%token TO EXCEPT DOTDOTDOT NULL_TOK CONST INTERNAL OPAQUE NOT
%token IMPLEMENTATION TRUE FALSE BEGINTOK ENDTOK DECLARE GLOBAL CONSTANT
%token TO EXCEPT DOTDOTDOT NULL_TOK CONST INTERNAL OPAQUE NOT EXTERNAL
// Basic Block Terminating Operators
%token <TermOpVal> RET BR SWITCH
@ -1145,7 +1145,7 @@ ConstPool : ConstPool OptAssign CONST ConstVal {
}
}
}
| ConstPool OptAssign OptInternal UNINIT GlobalType Types {
| ConstPool OptAssign OptInternal EXTERNAL GlobalType Types {
const Type *Ty = *$6;
// Global declarations appear in Constant Pool
GlobalVariable *GV = new GlobalVariable(Ty, $5, $3);