[cfe-commits] r42809 - /cfe/trunk/Parse/Parser.cpp

Chris Lattner sabre at nondot.org
Tue Oct 9 13:37:19 PDT 2007


Author: lattner
Date: Tue Oct  9 15:37:18 2007
New Revision: 42809

URL: http://llvm.org/viewvc/llvm-project?rev=42809&view=rev
Log:
avoid a noop virtual method call on the hot scope poping path.

Modified:
    cfe/trunk/Parse/Parser.cpp

Modified: cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/Parser.cpp?rev=42809&r1=42808&r2=42809&view=diff

==============================================================================
--- cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/trunk/Parse/Parser.cpp Tue Oct  9 15:37:18 2007
@@ -189,8 +189,10 @@
 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();





More information about the cfe-commits mailing list