Fix stylistic and documentation problems in ValueMap found by Nick Lewycky and
[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 namespace llvm {
19
20 class LLVMContextImpl;
21 class MetadataContext;
22
23 /// This is an important class for using LLVM in a threaded context.  It
24 /// (opaquely) owns and manages the core "global" data of LLVM's core 
25 /// infrastructure, including the type and constant uniquing tables.
26 /// LLVMContext itself provides no locking guarantees, so you should be careful
27 /// to have one context per thread.
28 class LLVMContext {
29   // DO NOT IMPLEMENT
30   LLVMContext(LLVMContext&);
31   void operator=(LLVMContext&);
32
33 public:
34   LLVMContextImpl* const pImpl;
35   MetadataContext &getMetadata();
36   LLVMContext();
37   ~LLVMContext();
38 };
39
40 /// FOR BACKWARDS COMPATIBILITY - Returns a global context.
41 extern LLVMContext& getGlobalContext();
42
43 }
44
45 #endif