[cfe-commits] r39042 - /cfe/cfe/trunk/Parse/ParseStmt.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:27:04 PDT 2007
Author: sabre
Date: Wed Jul 11 11:27:03 2007
New Revision: 39042
URL: http://llvm.org/viewvc/llvm-project?rev=39042&view=rev
Log:
Compoundstmts imply a scope, track it. This implements
test/Parser/CompoundStmtScope.c
Modified:
cfe/cfe/trunk/Parse/ParseStmt.cpp
Modified: cfe/cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseStmt.cpp?rev=39042&r1=39041&r2=39042&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseStmt.cpp Wed Jul 11 11:27:03 2007
@@ -364,6 +364,9 @@
assert(Tok.getKind() == tok::l_brace && "Not a compount stmt!");
SourceLocation LBraceLoc = ConsumeBrace(); // eat the '{'.
+ // Enter a scope to hold everything within the function.
+ EnterScope();
+
SmallVector<StmtTy*, 32> Stmts;
while (Tok.getKind() != tok::r_brace && Tok.getKind() != tok::eof) {
StmtResult R = ParseStatementOrDeclaration(false);
@@ -377,6 +380,8 @@
return 0;
}
+ ExitScope();
+
SourceLocation RBraceLoc = ConsumeBrace();
return Actions.ParseCompoundStmt(LBraceLoc, RBraceLoc,
&Stmts[0], Stmts.size());
More information about the cfe-commits
mailing list