aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-30 21:47:07 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-30 21:47:07 +0000
commit6228ca00121669ec06a19df4fad87d5049c097cf (patch)
tree9b1fc82ed352c75da4bf37c7b31a5c83f41c8e37 /lib/Frontend/CompilerInstance.cpp
parent95c9ce952dd90f0ef66660c905fe99c51b7e835d (diff)
CompilerInstance: Change to not contain the CompilerInvocation object.
This allows clients to install their own CompilerInvocation object, which is important for clients that may wish to create references to things like LangOptions whose lifetime will extend past that of the CompilerInstance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 6b0fdb8a34..a630486688 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -38,14 +38,19 @@ using namespace clang;
CompilerInstance::CompilerInstance(llvm::LLVMContext *_LLVMContext,
bool _OwnsLLVMContext)
: LLVMContext(_LLVMContext),
- OwnsLLVMContext(_OwnsLLVMContext) {
- }
+ OwnsLLVMContext(_OwnsLLVMContext),
+ Invocation(new CompilerInvocation) {
+}
CompilerInstance::~CompilerInstance() {
if (OwnsLLVMContext)
delete LLVMContext;
}
+void CompilerInstance::setInvocation(CompilerInvocation *Value) {
+ Invocation.reset(Value);
+}
+
void CompilerInstance::setDiagnostics(Diagnostic *Value) {
Diagnostics.reset(Value);
}