forked from OSchip/llvm-project
Allow open/closing curly braces instead of begin/end to define the body of a function
llvm-svn: 2451
This commit is contained in:
parent
732c209e83
commit
1e1a9b4166
|
@ -147,7 +147,7 @@ HexFPConstant 0x[0-9A-Fa-f]+
|
|||
{Comment} { /* Ignore comments for now */ }
|
||||
|
||||
begin { return BEGINTOK; }
|
||||
end { return END; }
|
||||
end { return ENDTOK; }
|
||||
true { return TRUE; }
|
||||
false { return FALSE; }
|
||||
declare { return DECLARE; }
|
||||
|
|
|
@ -671,7 +671,7 @@ Module *RunVMAsmParser(const string &Filename, FILE *F) {
|
|||
%type <StrVal> OptVAR_ID OptAssign
|
||||
|
||||
|
||||
%token IMPLEMENTATION TRUE FALSE BEGINTOK END DECLARE GLOBAL CONSTANT UNINIT
|
||||
%token IMPLEMENTATION TRUE FALSE BEGINTOK ENDTOK DECLARE GLOBAL CONSTANT UNINIT
|
||||
%token TO EXCEPT DOTDOTDOT STRING NULL_TOK CONST INTERNAL OPAQUE
|
||||
|
||||
// Basic Block Terminating Operators
|
||||
|
@ -1205,13 +1205,17 @@ FunctionHeaderH : OptInternal TypesV STRINGCONSTANT '(' ArgList ')' {
|
|||
}
|
||||
}
|
||||
|
||||
FunctionHeader : FunctionHeaderH ConstPool BEGINTOK {
|
||||
BEGIN : BEGINTOK | '{'; // Allow BEGIN or '{' to start a function
|
||||
|
||||
FunctionHeader : FunctionHeaderH BEGIN {
|
||||
$$ = CurMeth.CurrentFunction;
|
||||
|
||||
// Resolve circular types before we parse the body of the method.
|
||||
ResolveTypes(CurMeth.LateResolveTypes);
|
||||
}
|
||||
|
||||
END : ENDTOK | '}'; // Allow end of '}' to end a function
|
||||
|
||||
Function : BasicBlockList END {
|
||||
$$ = $1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue