Daniel Dunbar | 636404a | 2009-11-13 03:51:44 +0000 | [diff] [blame^] | 1 | //===--- CompilerInstance.cpp ---------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "clang/Frontend/CompilerInstance.h" |
| 11 | #include "clang/Basic/Diagnostic.h" |
| 12 | #include "clang/Basic/TargetInfo.h" |
| 13 | #include "llvm/LLVMContext.h" |
| 14 | using namespace clang; |
| 15 | |
| 16 | CompilerInstance::CompilerInstance(llvm::LLVMContext *_LLVMContext, |
| 17 | bool _OwnsLLVMContext) |
| 18 | : LLVMContext(_LLVMContext), |
| 19 | OwnsLLVMContext(_OwnsLLVMContext) { |
| 20 | } |
| 21 | |
| 22 | CompilerInstance::~CompilerInstance() { |
| 23 | if (OwnsLLVMContext) |
| 24 | delete LLVMContext; |
| 25 | } |