Factor some of the constants+context related code out into a separate header, to...
[oota-llvm.git] / include / llvm / LLVMContext.h
1 //===-- llvm/LLVMContext.h - Class for managing "global" state --*- C++ -*-===//
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 // This file declares LLVMContext, a container of "global" state in LLVM, such
11 // as the global type and constant uniquing tables.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_LLVMCONTEXT_H
16 #define LLVM_LLVMCONTEXT_H
17
18 #include "llvm/Support/DataTypes.h"
19 #include <vector>
20 #include <string>
21
22 namespace llvm {
23
24 class APFloat;
25 class APInt;
26 class ArrayType;
27 class Constant;
28 class ConstantAggregateZero;
29 class ConstantArray;
30 class ConstantFP;
31 class ConstantInt;
32 class ConstantPointerNull;
33 class ConstantStruct;
34 class ConstantVector;
35 class FunctionType;
36 class IntegerType;
37 struct LLVMContextImpl;
38 class MDNode;
39 class MDString;
40 class OpaqueType;
41 class PointerType;
42 class StringRef;
43 class StructType;
44 class Type;
45 class UndefValue;
46 class Use;
47 class Value;
48 class VectorType;
49
50 /// This is an important class for using LLVM in a threaded context.  It
51 /// (opaquely) owns and manages the core "global" data of LLVM's core 
52 /// infrastructure, including the type and constant uniquing tables.
53 /// LLVMContext itself provides no locking guarantees, so you should be careful
54 /// to have one context per thread.
55 struct LLVMContext {
56   LLVMContextImpl* pImpl;
57   
58   LLVMContext();
59   ~LLVMContext();
60 };
61
62 /// FOR BACKWARDS COMPATIBILITY - Returns a global context.
63 extern LLVMContext& getGlobalContext();
64
65 }
66
67 #endif