diff options
author | Chris Lattner <sabre@nondot.org> | 2003-07-23 15:22:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-07-23 15:22:26 +0000 |
commit | c07736a397012499e337c994f7f952b07c709544 (patch) | |
tree | e7ff1fb8eee2ca15a8f6edd4e537aecf7fe6be56 /lib/Transforms/TransformInternals.h | |
parent | c8bf87af3efe766440d0df259a038a0b6998e6e9 (diff) | |
download | external_llvm-c07736a397012499e337c994f7f952b07c709544.zip external_llvm-c07736a397012499e337c994f7f952b07c709544.tar.gz external_llvm-c07736a397012499e337c994f7f952b07c709544.tar.bz2 |
Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/TransformInternals.h')
-rw-r--r-- | lib/Transforms/TransformInternals.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h index 8cab429..5f87a38 100644 --- a/lib/Transforms/TransformInternals.h +++ b/lib/Transforms/TransformInternals.h @@ -16,9 +16,7 @@ #include <set> static inline int64_t getConstantValue(const ConstantInt *CPI) { - if (const ConstantSInt *CSI = dyn_cast<ConstantSInt>(CPI)) - return CSI->getValue(); - return (int64_t)cast<ConstantUInt>(CPI)->getValue(); + return (int64_t)cast<ConstantInt>(CPI)->getRawValue(); } |