diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Frontend/ASTUnit.h | 1 | ||||
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 10 | ||||
-rw-r--r-- | clang/test/Index/pch-with-module.m | 23 |
3 files changed, 34 insertions, 0 deletions
diff --git a/clang/include/clang/Frontend/ASTUnit.h b/clang/include/clang/Frontend/ASTUnit.h index 02c57d7472a..9bd0ef31e09 100644 --- a/clang/include/clang/Frontend/ASTUnit.h +++ b/clang/include/clang/Frontend/ASTUnit.h @@ -471,6 +471,7 @@ public: return OriginalSourceFile; } + ASTMutationListener *getASTMutationListener(); ASTDeserializationListener *getDeserializationListener(); /// \brief Add a temporary file that the ASTUnit depends on. diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index f05d7225465..7850dc697be 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -638,6 +638,12 @@ void StoredDiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level Level, StoredDiags.push_back(StoredDiagnostic(Level, Info)); } +ASTMutationListener *ASTUnit::getASTMutationListener() { + if (WriterData) + return &WriterData->Writer; + return 0; +} + ASTDeserializationListener *ASTUnit::getDeserializationListener() { if (WriterData) return &WriterData->Writer; @@ -929,6 +935,10 @@ public: handleTopLevelDecl(*it); } + virtual ASTMutationListener *GetASTMutationListener() { + return Unit.getASTMutationListener(); + } + virtual ASTDeserializationListener *GetASTDeserializationListener() { return Unit.getDeserializationListener(); } diff --git a/clang/test/Index/pch-with-module.m b/clang/test/Index/pch-with-module.m new file mode 100644 index 00000000000..e839c811dab --- /dev/null +++ b/clang/test/Index/pch-with-module.m @@ -0,0 +1,23 @@ +// RUN: rm -rf %t.cache +// RUN: c-index-test -write-pch %t.h.pch %s -target x86_64-apple-macosx10.7 -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash +// RUN: %clang -fsyntax-only %s -target x86_64-apple-macosx10.7 -include %t.h -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \ +// RUN: -Xclang -fdisable-module-hash -Xclang -detailed-preprocessing-record -Xclang -verify + +// expected-no-diagnostics + +#ifndef PCH_HEADER +#define PCH_HEADER + +#include <Module/Module.h> + +@interface Module(PCHCat) +-(id)PCH_meth; +@end + +#else + +void foo(Module *m) { + [m PCH_meth]; +} + +#endif |