]> granicus.if.org Git - clang/commitdiff
When code completion is enabled, don't do any work in
authorDouglas Gregor <dgregor@apple.com>
Fri, 17 Aug 2012 22:17:36 +0000 (22:17 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 17 Aug 2012 22:17:36 +0000 (22:17 +0000)
Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp

index 7f79f0c6d98a195a5bb1999587dfd1189ee17fa0..62c7375ec6661272de79422bc7d702444bef7d7e 100644 (file)
@@ -507,6 +507,11 @@ void Sema::ActOnEndOfTranslationUnit() {
   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) {