]> granicus.if.org Git - clang/commitdiff
Refactor: move loading pending instantiations from chained PCHs to a more appropriate...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 22 Mar 2014 01:43:32 +0000 (01:43 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 22 Mar 2014 01:43:32 +0000 (01:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/Modules/Inputs/module.map

index aa223bacabae7c0e6f110ce798448bbd6ea77ff1..3612bb962c96edd9febe606d826d21c03372ad75 100644 (file)
@@ -620,7 +620,15 @@ void Sema::ActOnEndOfTranslationUnit() {
     // so it will find some names that are not required to be found. This is
     // valid, but we could do better by diagnosing if an instantiation uses a
     // name that was not visible at its first point of instantiation.
+    if (ExternalSource) {
+      // Load pending instantiations from the external source.
+      SmallVector<PendingImplicitInstantiation, 4> Pending;
+      ExternalSource->ReadPendingInstantiations(Pending);
+      PendingInstantiations.insert(PendingInstantiations.begin(),
+                                   Pending.begin(), Pending.end());
+    }
     PerformPendingInstantiations();
+
     CheckDelayedMemberExceptionSpecs();
   }
 
index 029f9a2dcbf0e712c9851db6d773ad79e0ca28c7..376f6f79f4c0ff6d5ffcdd9a26bf9466df79d085 100644 (file)
@@ -3439,6 +3439,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
 
     PerformDependentDiagnostics(PatternDecl, TemplateArgs);
 
+    // FIXME: Notify the ASTMutationListener that we did this.
+
     savedContext.pop();
   }
 
@@ -4592,14 +4594,6 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
 /// \brief Performs template instantiation for all implicit template
 /// instantiations we have seen until this point.
 void Sema::PerformPendingInstantiations(bool LocalOnly) {
-  // Load pending instantiations from the external source.
-  if (!LocalOnly && ExternalSource) {
-    SmallVector<PendingImplicitInstantiation, 4> Pending;
-    ExternalSource->ReadPendingInstantiations(Pending);
-    PendingInstantiations.insert(PendingInstantiations.begin(),
-                                 Pending.begin(), Pending.end());
-  }
-
   while (!PendingLocalImplicitInstantiations.empty() ||
          (!LocalOnly && !PendingInstantiations.empty())) {
     PendingImplicitInstantiation Inst;
index 574eba47594c27defd31bd09d74ac90830e97e8e..9f0fc0a29dc23fb46d5a9f8315178d490b4e52fd 100644 (file)
@@ -15,6 +15,9 @@ module diamond_bottom {
   export *
 }
 module irgen { header "irgen.h" }
+module cxx_irgen_top { header "cxx-irgen-top.h" }
+module cxx_irgen_left { header "cxx-irgen-left.h" }
+module cxx_irgen_right { header "cxx-irgen-right.h" }
 module lookup_left_objc { header "lookup_left.h" }
 module lookup_right_objc { header "lookup_right.h" }
 module lookup_left_cxx { header "lookup_left.hpp" }