2009-06-30 00:48:55 +00: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 17:06:46 +00:00
|
|
|
//
|
|
|
|
// This file declares LLVMContext, a container of "global" state in LLVM, such
|
|
|
|
// as the global type and constant uniquing tables.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-06-30 00:48:55 +00:00
|
|
|
|
|
|
|
#ifndef LLVM_LLVMCONTEXT_H
|
|
|
|
#define LLVM_LLVMCONTEXT_H
|
|
|
|
|
|
|
|
#include "llvm/Support/DataTypes.h"
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2009-07-25 06:02:13 +00:00
|
|
|
class APFloat;
|
|
|
|
class APInt;
|
|
|
|
class ArrayType;
|
2009-06-30 00:48:55 +00:00
|
|
|
class Constant;
|
|
|
|
class ConstantAggregateZero;
|
|
|
|
class ConstantArray;
|
|
|
|
class ConstantFP;
|
2009-07-25 06:02:13 +00:00
|
|
|
class ConstantInt;
|
|
|
|
class ConstantPointerNull;
|
|
|
|
class ConstantStruct;
|
2009-06-30 00:48:55 +00:00
|
|
|
class ConstantVector;
|
2009-07-25 06:02:13 +00:00
|
|
|
class FunctionType;
|
|
|
|
class IntegerType;
|
|
|
|
class LLVMContextImpl;
|
2009-07-02 17:12:48 +00:00
|
|
|
class MDNode;
|
2009-07-02 17:19:47 +00:00
|
|
|
class MDString;
|
2009-07-25 06:02:13 +00:00
|
|
|
class OpaqueType;
|
2009-06-30 00:48:55 +00:00
|
|
|
class PointerType;
|
2009-07-25 06:02:13 +00:00
|
|
|
class StringRef;
|
2009-06-30 00:48:55 +00:00
|
|
|
class StructType;
|
|
|
|
class Type;
|
2009-07-25 06:02:13 +00:00
|
|
|
class UndefValue;
|
2009-07-21 20:55:28 +00:00
|
|
|
class Use;
|
2009-07-25 06:02:13 +00:00
|
|
|
class Value;
|
|
|
|
class VectorType;
|
2009-06-30 00:48:55 +00:00
|
|
|
|
2009-06-30 17:06:46 +00: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-06-30 00:48:55 +00:00
|
|
|
class LLVMContext {
|
|
|
|
LLVMContextImpl* pImpl;
|
2009-07-24 23:12:02 +00:00
|
|
|
|
|
|
|
friend class ConstantInt;
|
2009-07-27 20:59:43 +00:00
|
|
|
friend class ConstantFP;
|
2009-07-27 22:29:26 +00:00
|
|
|
friend class ConstantStruct;
|
2009-07-28 18:32:17 +00:00
|
|
|
friend class ConstantArray;
|
2009-07-28 21:19:26 +00:00
|
|
|
friend class ConstantVector;
|
2009-07-30 23:03:37 +00:00
|
|
|
friend class ConstantAggregateZero;
|
2009-07-31 21:35:40 +00:00
|
|
|
friend class MDNode;
|
|
|
|
friend class MDString;
|
2009-06-30 00:48:55 +00:00
|
|
|
public:
|
|
|
|
LLVMContext();
|
|
|
|
~LLVMContext();
|
|
|
|
};
|
|
|
|
|
2009-06-30 23:39:59 +00:00
|
|
|
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
|
2009-07-01 23:13:44 +00:00
|
|
|
extern LLVMContext& getGlobalContext();
|
2009-06-30 23:39:59 +00:00
|
|
|
|
2009-06-30 00:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|