From 2a79e162a3fde25c1941151a67966830d873f2db Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 13 Nov 2009 03:51:44 +0000 Subject: Add CompilerInstance, and starting moving clang-cc to it. - The design philosophy is in the CompilerInstance doxyment, if you don't agree with it now would be a good time to speak up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87078 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInstance.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/Frontend/CompilerInstance.cpp (limited to 'lib/Frontend/CompilerInstance.cpp') diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp new file mode 100644 index 0000000000..e791f24ee8 --- /dev/null +++ b/lib/Frontend/CompilerInstance.cpp @@ -0,0 +1,25 @@ +//===--- CompilerInstance.cpp ---------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/Frontend/CompilerInstance.h" +#include "clang/Basic/Diagnostic.h" +#include "clang/Basic/TargetInfo.h" +#include "llvm/LLVMContext.h" +using namespace clang; + +CompilerInstance::CompilerInstance(llvm::LLVMContext *_LLVMContext, + bool _OwnsLLVMContext) + : LLVMContext(_LLVMContext), + OwnsLLVMContext(_OwnsLLVMContext) { +} + +CompilerInstance::~CompilerInstance() { + if (OwnsLLVMContext) + delete LLVMContext; +} -- cgit v1.2.3-18-g5258