diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-05 00:49:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-05 00:49:17 +0000 |
commit | 12f2ea501594c0559e45a11ccd869a2cfc7e12ea (patch) | |
tree | 24531ddf19d99405637a83228b482e8c3c11f7e1 /clang/lib/Parse/ParseStmt.cpp | |
parent | ad6b47377f6aa8214a900fb66b5caa443b462aae (diff) | |
download | bcm5719-llvm-12f2ea501594c0559e45a11ccd869a2cfc7e12ea.tar.gz bcm5719-llvm-12f2ea501594c0559e45a11ccd869a2cfc7e12ea.zip |
Simplify the interface to ParseFunctionStatementBody to not take
locations that are the current tok loc. Note that inline C++ methods
have a big fixme that could cause a crash.
llvm-svn: 66113
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 4f7affc69ca..1ecbe8bd84a 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1284,8 +1284,10 @@ bool Parser::ParseAsmOperandsOpt(llvm::SmallVectorImpl<std::string> &Names, return true; } -Parser::DeclTy *Parser::ParseFunctionStatementBody(DeclTy *Decl, - SourceLocation L, SourceLocation R) { +Parser::DeclTy *Parser::ParseFunctionStatementBody(DeclTy *Decl) { + assert(Tok.is(tok::l_brace)); + SourceLocation LBraceLoc = Tok.getLocation(); + // Do not enter a scope for the brace, as the arguments are in the same scope // (the function body) as the body itself. Instead, just read the statement // list and put it into a CompoundStmt for safe keeping. @@ -1293,7 +1295,8 @@ Parser::DeclTy *Parser::ParseFunctionStatementBody(DeclTy *Decl, // If the function body could not be parsed, make a bogus compoundstmt. if (FnBody.isInvalid()) - FnBody = Actions.ActOnCompoundStmt(L, R, MultiStmtArg(Actions), false); + FnBody = Actions.ActOnCompoundStmt(LBraceLoc, LBraceLoc, + MultiStmtArg(Actions), false); return Actions.ActOnFinishFunctionBody(Decl, move(FnBody)); } |