class ConstantVector;
class FunctionType;
class IntegerType;
-class LLVMContextImpl;
+struct LLVMContextImpl;
class MDNode;
class MDString;
class OpaqueType;
/// 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.
-class LLVMContext {
+struct LLVMContext {
LLVMContextImpl* pImpl;
- friend class ConstantInt;
- friend class ConstantFP;
- friend class ConstantStruct;
- friend class ConstantArray;
- friend class ConstantVector;
- friend class ConstantAggregateZero;
-public:
LLVMContext();
~LLVMContext();
-
- // Constant accessors
- Constant* getNullValue(const Type* Ty);
-
- /// @returns the value for an integer constant of the given type that has all
- /// its bits set to true.
- /// @brief Get the all ones value
- Constant* getAllOnesValue(const Type* Ty);
-
- // ConstantInt accessors
- ConstantInt* getTrue();
- ConstantInt* getFalse();
-
- // MDNode accessors
- MDNode* getMDNode(Value* const* Vals, unsigned NumVals);
-
- // MDString accessors
- MDString* getMDString(const StringRef &Str);
-
-
- // Methods for erasing constants
- void erase(MDString *M);
- void erase(MDNode *M);
};
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.