diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-06 00:32:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-06 00:32:01 +0000 |
commit | 9a007fcb67ebc847266b84b9f5add2b16cfff22b (patch) | |
tree | 96d3e38c7e5aa1b3a6e9c739cc01d86472b14c33 /include/clang/Frontend/ASTUnit.h | |
parent | 532a634d671d1dad27d4e7ce0c97d9411ab22447 (diff) |
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
Diffstat (limited to 'include/clang/Frontend/ASTUnit.h')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 14 |
1 files changed, 13 insertions, 1 deletions
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<ASTContext> Ctx; std::shared_ptr<TargetOptions> TargetOpts; std::shared_ptr<HeaderSearchOptions> HSOpts; + std::shared_ptr<PreprocessorOptions> PPOpts; IntrusiveRefCntPtr<ASTReader> 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; } |