- // Constant accessors
- Constant* getNullValue(const Type* Ty);
- Constant* getAllOnesValue(const Type* Ty);
-
- // UndefValue accessors
- UndefValue* getUndef(const Type* Ty);
-
- // ConstantInt accessors
- ConstantInt* getConstantIntTrue();
- ConstantInt* getConstantIntFalse();
- Constant* getConstantInt(const Type* Ty, uint64_t V,
- bool isSigned = false);
- ConstantInt* getConstantInt(const IntegerType* Ty, uint64_t V,
- bool isSigned = false);
- ConstantInt* getConstantIntSigned(const IntegerType* Ty, int64_t V);
- ConstantInt* getConstantInt(const APInt& V);
- Constant* getConstantInt(const Type* Ty, const APInt& V);
- ConstantInt* getConstantIntAllOnesValue(const Type* Ty);
-
- // ConstantPointerNull accessors
- ConstantPointerNull* getConstantPointerNull(const PointerType* T);
-
- // ConstantStruct accessors
- Constant* getConstantStruct(const StructType* T,
- const std::vector<Constant*>& V);
- Constant* getConstantStruct(const std::vector<Constant*>& V,
- bool Packed = false);
- Constant* getConstantStruct(Constant* const *Vals, unsigned NumVals,
- bool Packed = false);
-
- // ConstantAggregateZero accessors
- ConstantAggregateZero* getConstantAggregateZero(const Type* Ty);
-
- // ConstantArray accessors
- Constant* getConstantArray(const ArrayType* T,
- const std::vector<Constant*>& V);
- Constant* getConstantArray(const ArrayType* T, Constant* const* Vals,
- unsigned NumVals);
- Constant* getConstantArray(const std::string& Initializer,
- bool AddNull = true);
-
- // ConstantExpr accessors
- Constant* getConstantExpr(unsigned Opcode, Constant* C1, Constant* C2);
- Constant* getConstantExprTrunc(Constant* C, const Type* Ty);
- Constant* getConstantExprSExt(Constant* C, const Type* Ty);
- Constant* getConstantExprZExt(Constant* C, const Type* Ty);
- Constant* getConstantExprFPTrunc(Constant* C, const Type* Ty);
- Constant* getConstantExprFPExtend(Constant* C, const Type* Ty);
- Constant* getConstantExprUIToFP(Constant* C, const Type* Ty);
- Constant* getConstantExprSIToFP(Constant* C, const Type* Ty);
- Constant* getConstantExprFPToUI(Constant* C, const Type* Ty);
- Constant* getConstantExprFPToSI(Constant* C, const Type* Ty);
- Constant* getConstantExprPtrToInt(Constant* C, const Type* Ty);
- Constant* getConstantExprIntToPtr(Constant* C, const Type* Ty);
- Constant* getConstantExprBitCast(Constant* C, const Type* Ty);
- Constant* getConstantExprCast(unsigned ops, Constant* C, const Type* Ty);
- Constant* getConstantExprZExtOrBitCast(Constant* C, const Type* Ty);
- Constant* getConstantExprSExtOrBitCast(Constant* C, const Type* Ty);
- Constant* getConstantExprTruncOrBitCast(Constant* C, const Type* Ty);
- Constant* getConstantExprPointerCast(Constant* C, const Type* Ty);
- Constant* getConstantExprIntegerCast(Constant* C, const Type* Ty,
- bool isSigned);
- Constant* getConstantExprFPCast(Constant* C, const Type* Ty);
- Constant* getConstantExprSelect(Constant* C, Constant* V1, Constant* V2);
-
- /// getAlignOf constant expr - computes the alignment of a type in a target
- /// independent way (Note: the return type is an i32; Note: assumes that i8
- /// is byte aligned).
+ // Pinned metadata names, which always have the same value. This is a
+ // compile-time performance optimization, not a correctness optimization.
+ enum {
+ MD_dbg = 0, // "dbg"
+ MD_tbaa = 1, // "tbaa"
+ MD_prof = 2, // "prof"
+ MD_fpmath = 3, // "fpmath"
+ MD_range = 4, // "range"
+ MD_tbaa_struct = 5 // "tbaa.struct"
+ };
+
+ /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
+ /// This ID is uniqued across modules in the current LLVMContext.
+ unsigned getMDKindID(StringRef Name) const;
+
+ /// getMDKindNames - Populate client supplied SmallVector with the name for
+ /// custom metadata IDs registered in this LLVMContext.
+ void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
+
+ typedef void (*InlineAsmDiagHandlerTy)(const SMDiagnostic&, void *Context,
+ unsigned LocCookie);
+
+ /// setInlineAsmDiagnosticHandler - This method sets a handler that is invoked
+ /// when problems with inline asm are detected by the backend. The first
+ /// argument is a function pointer and the second is a context pointer that
+ /// gets passed into the DiagHandler.