aboutsummaryrefslogtreecommitdiff
path: root/Parse/Parser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-09 20:37:18 +0000
committerChris Lattner <sabre@nondot.org>2007-10-09 20:37:18 +0000
commit90ae68aae98f12fe1950c63e2f6bd0fabce6cb1e (patch)
tree6cb959c5d013cf79d149c533f2a8d59bf30bd4a7 /Parse/Parser.cpp
parent05f6e6bb3a3e8e604c64f04f4ba7ef0e7569cf4e (diff)
avoid a noop virtual method call on the hot scope poping path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/Parser.cpp')
-rw-r--r--Parse/Parser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp
index 26835825d8..117afab5cf 100644
--- a/Parse/Parser.cpp
+++ b/Parse/Parser.cpp
@@ -189,8 +189,10 @@ void Parser::EnterScope(unsigned ScopeFlags) {
void Parser::ExitScope() {
assert(CurScope && "Scope imbalance!");
- // Inform the actions module that this scope is going away.
- Actions.PopScope(Tok.getLocation(), CurScope);
+ // Inform the actions module that this scope is going away if there are any
+ // decls in it.
+ if (!CurScope->decl_empty())
+ Actions.PopScope(Tok.getLocation(), CurScope);
Scope *OldScope = CurScope;
CurScope = OldScope->getParent();