2009-06-30 08:48:55 +08:00
|
|
|
//===-- LLVMContext.cpp - Implement LLVMContext -----------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-07-01 01:06:46 +08:00
|
|
|
//
|
|
|
|
// This file implements LLVMContext, as a wrapper around the opaque
|
|
|
|
// class LLVMContextImpl.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-06-30 08:48:55 +08:00
|
|
|
|
|
|
|
#include "llvm/LLVMContext.h"
|
|
|
|
#include "llvm/Constants.h"
|
2009-07-01 01:50:28 +08:00
|
|
|
#include "llvm/DerivedTypes.h"
|
2009-07-13 12:09:18 +08:00
|
|
|
#include "llvm/Instruction.h"
|
2009-07-29 05:49:47 +08:00
|
|
|
#include "llvm/Metadata.h"
|
2009-07-01 07:39:59 +08:00
|
|
|
#include "llvm/Support/ManagedStatic.h"
|
2009-06-30 08:48:55 +08:00
|
|
|
#include "LLVMContextImpl.h"
|
2009-07-13 13:49:04 +08:00
|
|
|
#include <cstdarg>
|
2009-06-30 08:48:55 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2009-07-01 07:39:59 +08:00
|
|
|
static ManagedStatic<LLVMContext> GlobalContext;
|
|
|
|
|
2009-07-02 07:13:44 +08:00
|
|
|
LLVMContext& llvm::getGlobalContext() {
|
2009-07-02 05:22:36 +08:00
|
|
|
return *GlobalContext;
|
2009-07-01 07:39:59 +08:00
|
|
|
}
|
|
|
|
|
2009-07-17 02:04:31 +08:00
|
|
|
LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { }
|
2009-06-30 08:48:55 +08:00
|
|
|
LLVMContext::~LLVMContext() { delete pImpl; }
|