diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-01-30 21:47:07 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-01-30 21:47:07 +0000 |
commit | 6228ca00121669ec06a19df4fad87d5049c097cf (patch) | |
tree | 9b1fc82ed352c75da4bf37c7b31a5c83f41c8e37 /lib/Frontend/CompilerInstance.cpp | |
parent | 95c9ce952dd90f0ef66660c905fe99c51b7e835d (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.cpp | 9 |
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); } |