Add LLVM{U}IntAsType() utility routine

This commit is contained in:
Matt Pharr
2012-03-05 06:22:40 -08:00
parent ff48dd7bfb
commit e482d29951
2 changed files with 44 additions and 0 deletions

View File

@@ -173,6 +173,14 @@ extern llvm::Constant *LLVMFloatVector(float f);
across all elements */
extern llvm::Constant *LLVMDoubleVector(double f);
/** Returns a constant integer or vector (according to the given type) of
the given signed integer value. */
extern llvm::Constant *LLVMIntAsType(int64_t, LLVM_TYPE_CONST llvm::Type *t);
/** Returns a constant integer or vector (according to the given type) of
the given unsigned integer value. */
extern llvm::Constant *LLVMUIntAsType(uint64_t, LLVM_TYPE_CONST llvm::Type *t);
/** Returns an LLVM boolean vector based on the given array of values.
The array should have g->target.vectorWidth elements. */
extern llvm::Constant *LLVMBoolVector(const bool *v);