aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r--include/clang/Frontend/ASTUnit.h2
-rw-r--r--include/clang/Frontend/CompilerInstance.h4
-rw-r--r--include/clang/Frontend/CompilerInvocation.h12
3 files changed, 11 insertions, 7 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 26828a4427..ae192fa7c3 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -20,6 +20,7 @@
#include "clang/Sema/CodeCompleteConsumer.h"
#include "clang/Lex/ModuleLoader.h"
#include "clang/Lex/PreprocessingRecord.h"
+#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
@@ -69,6 +70,7 @@ class GlobalCodeCompletionAllocator
///
class ASTUnit : public ModuleLoader {
private:
+ llvm::IntrusiveRefCntPtr<LangOptions> LangOpts;
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics;
llvm::IntrusiveRefCntPtr<FileManager> FileMgr;
llvm::IntrusiveRefCntPtr<SourceManager> SourceMgr;
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index 881774022d..639c2f68d3 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -218,10 +218,10 @@ public:
}
LangOptions &getLangOpts() {
- return Invocation->getLangOpts();
+ return *Invocation->getLangOpts();
}
const LangOptions &getLangOpts() const {
- return Invocation->getLangOpts();
+ return *Invocation->getLangOpts();
}
PreprocessorOptions &getPreprocessorOpts() {
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h
index 47c70311dd..10cb4bc935 100644
--- a/include/clang/Frontend/CompilerInvocation.h
+++ b/include/clang/Frontend/CompilerInvocation.h
@@ -61,7 +61,7 @@ class CompilerInvocation : public llvm::RefCountedBase<CompilerInvocation> {
HeaderSearchOptions HeaderSearchOpts;
/// Options controlling the language variant.
- LangOptions LangOpts;
+ llvm::IntrusiveRefCntPtr<LangOptions> LangOpts;
/// Options controlling the preprocessor (aside from #include handling).
PreprocessorOptions PreprocessorOpts;
@@ -73,7 +73,7 @@ class CompilerInvocation : public llvm::RefCountedBase<CompilerInvocation> {
TargetOptions TargetOpts;
public:
- CompilerInvocation() {}
+ CompilerInvocation();
/// @name Utility Methods
/// @{
@@ -111,7 +111,7 @@ public:
/// \param LangStd - The input language standard.
void setLangDefaults(InputKind IK,
LangStandard::Kind LangStd = LangStandard::lang_unspecified) {
- setLangDefaults(LangOpts, IK, LangStd);
+ setLangDefaults(*LangOpts, IK, LangStd);
}
/// setLangDefaults - Set language defaults for the given input language and
@@ -166,8 +166,10 @@ public:
return FrontendOpts;
}
- LangOptions &getLangOpts() { return LangOpts; }
- const LangOptions &getLangOpts() const { return LangOpts; }
+ LangOptions *getLangOpts() { return LangOpts.getPtr(); }
+ const LangOptions *getLangOpts() const { return LangOpts.getPtr(); }
+
+ void setLangOpts(LangOptions *LangOpts);
PreprocessorOptions &getPreprocessorOpts() { return PreprocessorOpts; }
const PreprocessorOptions &getPreprocessorOpts() const {