aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:36:33 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:36:33 +0000
commit0e81f660dbb7c437a3c95427bb495eb18822e42c (patch)
treef6847222c9895be3024c899b73d882b4af4d3866 /include/llvm/Constants.h
parenta15d890c34b5e3a6373c410ebc58453f2d52f43b (diff)
Add helper functions to ConstantInt and ConstantFP to accept strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index a66773c0b5..fdcc53bc79 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -83,6 +83,11 @@ public:
/// Return a ConstantInt with the specified value and an implied Type. The
/// type is the integer type that corresponds to the bit width of the value.
static ConstantInt* get(LLVMContext &Context, const APInt& V);
+
+ /// Return a ConstantInt constructed from the string strStart with the given
+ /// radix.
+ static ConstantInt* get(const IntegerType* Ty, const StringRef& Str,
+ uint8_t radix);
/// If Ty is a vector type, return a Constant with a splat of the given
/// value. Otherwise return a ConstantInt for the given value.
@@ -250,6 +255,7 @@ public:
/// only be used for simple constant values like 2.0/1.0 etc, that are
/// known-valid both as host double and as the target format.
static Constant* get(const Type* Ty, double V);
+ static Constant* get(const Type* Ty, const StringRef& Str);
static ConstantFP* get(LLVMContext &Context, const APFloat& V);
static ConstantFP* getNegativeZero(const Type* Ty);