summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/ASTUnit.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-06 00:32:01 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-06 00:32:01 +0000
commit9a007fcb67ebc847266b84b9f5add2b16cfff22b (patch)
tree96d3e38c7e5aa1b3a6e9c739cc01d86472b14c33 /include/clang/Frontend/ASTUnit.h
parent532a634d671d1dad27d4e7ce0c97d9411ab22447 (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.h14
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; }