]> granicus.if.org Git - clang/commitdiff
Make ChainedIncludesSource an ExternalSemaSource, otherwise initialization of the...
authorSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 31 Mar 2011 19:29:24 +0000 (19:29 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Thu, 31 Mar 2011 19:29:24 +0000 (19:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128664 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ChainedIncludesSource.h
lib/Sema/SemaExprCXX.cpp
lib/Serialization/ChainedIncludesSource.cpp

index 90e74d913c7808c4efedd210921296cde82ed264..ceef4f2e34598e33d52676f42baef8354be2ba60 100644 (file)
 #ifndef LLVM_CLANG_SERIALIZATION_CHAINEDINCLUDESSOURCE_H
 #define LLVM_CLANG_SERIALIZATION_CHAINEDINCLUDESSOURCE_H
 
-#include "clang/AST/ExternalASTSource.h"
+#include "clang/Sema/ExternalSemaSource.h"
 #include <vector>
 
 namespace clang {
   class CompilerInstance;
 
-class ChainedIncludesSource : public ExternalASTSource {
+class ChainedIncludesSource : public ExternalSemaSource {
 public:
   virtual ~ChainedIncludesSource();
 
   static ChainedIncludesSource *create(CompilerInstance &CI);
 
 private:
-  ExternalASTSource &getFinalReader() const { return *FinalReader; }
+  ExternalSemaSource &getFinalReader() const { return *FinalReader; }
 
   std::vector<CompilerInstance *> CIs;
-  llvm::OwningPtr<ExternalASTSource> FinalReader;
+  llvm::OwningPtr<ExternalSemaSource> FinalReader;
 
   
 protected:
@@ -56,6 +56,16 @@ protected:
   virtual void FinishedDeserializing();
   virtual void StartTranslationUnit(ASTConsumer *Consumer);
   virtual void PrintStats();
+
+//===----------------------------------------------------------------------===//
+// ExternalSemaSource interface.
+//===----------------------------------------------------------------------===//
+
+  virtual void InitializeSema(Sema &S);
+  virtual void ForgetSema();
+  virtual std::pair<ObjCMethodList,ObjCMethodList> ReadMethodPool(Selector Sel);
+  virtual bool LookupUnqualified(LookupResult &R, Scope *S);
+
 };
 
 }
index 36079c2ce7fcec2f5f0a5075a99dbb66014053e4..8c81acc9d1576eb072982d1ee607dc1ff5d1e7ab 100644 (file)
@@ -343,7 +343,7 @@ ExprResult
 Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc,
                      bool isType, void *TyOrExpr, SourceLocation RParenLoc) {
   // Find the std::type_info type.
-  if (!StdNamespace)
+  if (!getStdNamespace())
     return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid));
 
   if (!CXXTypeInfoDecl) {
index aba1eae3d3b5d22765b0a02d5788116c0dd0854f..4b954191fceee1de462dac09755136d6425bcd30 100644 (file)
@@ -208,3 +208,18 @@ void ChainedIncludesSource::StartTranslationUnit(ASTConsumer *Consumer) {
 void ChainedIncludesSource::PrintStats() {
   return getFinalReader().PrintStats();
 }
+
+void ChainedIncludesSource::InitializeSema(Sema &S) {
+  return getFinalReader().InitializeSema(S);
+}
+void ChainedIncludesSource::ForgetSema() {
+  return getFinalReader().ForgetSema();
+}
+std::pair<ObjCMethodList,ObjCMethodList>
+ChainedIncludesSource::ReadMethodPool(Selector Sel) {
+  return getFinalReader().ReadMethodPool(Sel);
+}
+bool ChainedIncludesSource::LookupUnqualified(LookupResult &R, Scope *S) {
+  return getFinalReader().LookupUnqualified(R, S);
+}
+