From 6228ca00121669ec06a19df4fad87d5049c097cf Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 30 Jan 2010 21:47:07 +0000 Subject: 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 --- lib/Frontend/CompilerInstance.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/Frontend/CompilerInstance.cpp') 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); } -- cgit v1.2.3-18-g5258