2009-06-30 02:48:55 +02:00
|
|
|
//===-- llvm/LLVMContext.h - Class for managing "global" state --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-06-30 19:06:46 +02:00
|
|
|
//
|
|
|
|
// This file declares LLVMContext, a container of "global" state in LLVM, such
|
|
|
|
// as the global type and constant uniquing tables.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-06-30 02:48:55 +02:00
|
|
|
|
|
|
|
#ifndef LLVM_LLVMCONTEXT_H
|
|
|
|
#define LLVM_LLVMCONTEXT_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2009-08-11 19:45:13 +02:00
|
|
|
class LLVMContextImpl;
|
2009-06-30 02:48:55 +02:00
|
|
|
|
2009-06-30 19:06:46 +02:00
|
|
|
/// This is an important class for using LLVM in a threaded context. It
|
|
|
|
/// (opaquely) owns and manages the core "global" data of LLVM's core
|
|
|
|
/// infrastructure, including the type and constant uniquing tables.
|
|
|
|
/// LLVMContext itself provides no locking guarantees, so you should be careful
|
|
|
|
/// to have one context per thread.
|
2009-08-11 19:45:13 +02:00
|
|
|
class LLVMContext {
|
|
|
|
public:
|
2009-06-30 02:48:55 +02:00
|
|
|
LLVMContextImpl* pImpl;
|
2009-08-11 08:31:57 +02:00
|
|
|
bool RemoveDeadMetadata();
|
2009-06-30 02:48:55 +02:00
|
|
|
LLVMContext();
|
|
|
|
~LLVMContext();
|
|
|
|
};
|
|
|
|
|
2009-07-01 01:39:59 +02:00
|
|
|
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
|
2009-07-02 01:13:44 +02:00
|
|
|
extern LLVMContext& getGlobalContext();
|
2009-07-01 01:39:59 +02:00
|
|
|
|
2009-06-30 02:48:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|