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 | 682422546509c293b4d6236e3125ea747a9df7c8 (patch) | |
| tree | 2e5d4755e60f21e830d1ac20baec97f3a6599873 /clang/lib | |
| parent | 0c5d7448d8d80c4cc7e7844c3d922439c4f9b2ec (diff) | |
| download | bcm5719-llvm-682422546509c293b4d6236e3125ea747a9df7c8.tar.gz bcm5719-llvm-682422546509c293b4d6236e3125ea747a9df7c8.zip | |
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.
llvm-svn: 94923
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 6b0fdb8a343..a630486688e 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/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); } |

