[cfe-commits] r107473 - in /cfe/trunk: include/clang/AST/Type.h lib/Frontend/PCHReader.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Jul 2 04:55:20 PDT 2010


Author: akirtzidis
Date: Fri Jul  2 06:55:20 2010
New Revision: 107473

URL: http://llvm.org/viewvc/llvm-project?rev=107473&view=rev
Log:
Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

Modified:
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=107473&r1=107472&r2=107473&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Fri Jul  2 06:55:20 2010
@@ -2544,6 +2544,9 @@
 
   friend class ASTContext; // ASTContext creates these.
   friend class TagDecl; // TagDecl mutilates the Decl
+  friend class PCHReader; // FIXME: ASTContext::getInjectedClassNameType is not
+                          // currently suitable for PCH reading, too much
+                          // interdependencies.
   InjectedClassNameType(CXXRecordDecl *D, QualType TST)
     : Type(InjectedClassName, QualType(), true),
       Decl(D), InjectedType(TST) {

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=107473&r1=107472&r2=107473&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Jul  2 06:55:20 2010
@@ -2197,7 +2197,10 @@
   case pch::TYPE_INJECTED_CLASS_NAME: {
     CXXRecordDecl *D = cast<CXXRecordDecl>(GetDecl(Record[0]));
     QualType TST = GetType(Record[1]); // probably derivable
-    return Context->getInjectedClassNameType(D, TST);
+    // FIXME: ASTContext::getInjectedClassNameType is not currently suitable
+    // for PCH reading, too much interdependencies.
+    return
+      QualType(new (*Context, TypeAlignment) InjectedClassNameType(D, TST), 0);
   }
   
   case pch::TYPE_TEMPLATE_TYPE_PARM: {





More information about the cfe-commits mailing list