1 //===-- llvm/LLVMContext.h - Class for managing "global" state --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares LLVMContext, a container of "global" state in LLVM, such
11 // as the global type and constant uniquing tables.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LLVMCONTEXT_H
16 #define LLVM_LLVMCONTEXT_H
20 class LLVMContextImpl;
22 /// This is an important class for using LLVM in a threaded context. It
23 /// (opaquely) owns and manages the core "global" data of LLVM's core
24 /// infrastructure, including the type and constant uniquing tables.
25 /// LLVMContext itself provides no locking guarantees, so you should be careful
26 /// to have one context per thread.
29 LLVMContext(LLVMContext&);
30 void operator=(LLVMContext&);
32 LLVMContextImpl* pImpl;
33 bool RemoveDeadMetadata();
38 /// FOR BACKWARDS COMPATIBILITY - Returns a global context.
39 extern LLVMContext& getGlobalContext();