aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-05 00:49:17 +0000
committerChris Lattner <sabre@nondot.org>2009-03-05 00:49:17 +0000
commit40e9bc84a2ab49fc33c2b1a95c6674ab2b820e9e (patch)
tree295c22faaaedd440c116a7f076430195af52d9c5 /lib/Parse/ParseStmt.cpp
parent852157601505e0a641f1b66c9e2fb028f77bb7d1 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r--lib/Parse/ParseStmt.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 4f7affc69c..1ecbe8bd84 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/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));
}