[cfe-commits] r162144 - /cfe/trunk/lib/Sema/Sema.cpp
Douglas Gregor
dgregor at apple.com
Fri Aug 17 15:17:36 PDT 2012
Author: dgregor
Date: Fri Aug 17 17:17:36 2012
New Revision: 162144
URL: http://llvm.org/viewvc/llvm-project?rev=162144&view=rev
Log:
When code completion is enabled, don't do any work in
Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization.
Modified:
cfe/trunk/lib/Sema/Sema.cpp
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=162144&r1=162143&r2=162144&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Fri Aug 17 17:17:36 2012
@@ -507,6 +507,11 @@
assert(DelayedDiagnostics.getCurrentPool() == NULL
&& "reached end of translation unit with a pool attached?");
+ // If code completion is enabled, don't perform any end-of-translation-unit
+ // work.
+ if (PP.isCodeCompletionEnabled())
+ return;
+
// Only complete translation units define vtables and perform implicit
// instantiations.
if (TUKind == TU_Complete) {
More information about the cfe-commits
mailing list