From 9a007fcb67ebc847266b84b9f5add2b16cfff22b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 6 Jun 2017 00:32:01 +0000 Subject: Retain header search and preprocessing options from AST file when emitting preprocessed text for an AST file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304756 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Frontend/ASTUnit.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/clang/Frontend/ASTUnit.h') diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index a2a1796cd3..d05b7de0dc 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -54,6 +54,7 @@ class HeaderSearch; class InputKind; class MemoryBufferCache; class Preprocessor; +class PreprocessorOptions; class PCHContainerOperations; class PCHContainerReader; class TargetInfo; @@ -97,6 +98,7 @@ private: IntrusiveRefCntPtr Ctx; std::shared_ptr TargetOpts; std::shared_ptr HSOpts; + std::shared_ptr PPOpts; IntrusiveRefCntPtr Reader; bool HadModuleLoaderFatalFailure; @@ -516,9 +518,19 @@ public: } const LangOptions &getLangOpts() const { - assert(LangOpts && " ASTUnit does not have language options"); + assert(LangOpts && "ASTUnit does not have language options"); return *LangOpts; } + + const HeaderSearchOptions &getHeaderSearchOpts() const { + assert(HSOpts && "ASTUnit does not have header search options"); + return *HSOpts; + } + + const PreprocessorOptions &getPreprocessorOpts() const { + assert(PPOpts && "ASTUnit does not have preprocessor options"); + return *PPOpts; + } const FileManager &getFileManager() const { return *FileMgr; } FileManager &getFileManager() { return *FileMgr; } -- cgit v1.2.3