aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-23 02:47:22 +0000
committerChris Lattner <sabre@nondot.org>2010-11-23 02:47:22 +0000
commit5400570097a25f05694d451afed7f949281b789e (patch)
tree50ee8812e81014733fcc07c6fc443c5cf654b856 /lib/VMCore
parent79b967bd9fed0a3147d704ce269af6cc26aff391 (diff)
downloadexternal_llvm-5400570097a25f05694d451afed7f949281b789e.zip
external_llvm-5400570097a25f05694d451afed7f949281b789e.tar.gz
external_llvm-5400570097a25f05694d451afed7f949281b789e.tar.bz2
add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Core.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index b2be64c..eb0af30 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -547,6 +547,14 @@ LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0));
}
+LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy,
+ unsigned NumWords,
+ const uint64_t Words[]) {
+ IntegerType *Ty = unwrap<IntegerType>(IntTy);
+ return wrap(ConstantInt::get(Ty->getContext(),
+ APInt(Ty->getBitWidth(), NumWords, Words)));
+}
+
LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char Str[],
uint8_t Radix) {
return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str),