aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
committerChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
commitc07736a397012499e337c994f7f952b07c709544 (patch)
treee7ff1fb8eee2ca15a8f6edd4e537aecf7fe6be56 /lib/Target/CBackend/CBackend.cpp
parentc8bf87af3efe766440d0df259a038a0b6998e6e9 (diff)
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/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 6d6f145b92..c15c23e369 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -324,9 +324,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
// Do not include the last character, which we know is null
for (unsigned i = 0, e = CPA->getNumOperands()-1; i != e; ++i) {
- unsigned char C = (ETy == Type::SByteTy) ?
- (unsigned char)cast<ConstantSInt>(CPA->getOperand(i))->getValue() :
- (unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
+ unsigned char C = cast<ConstantInt>(CPA->getOperand(i))->getRawValue();
// Print it out literally if it is a printable character. The only thing
// to be careful about is when the last letter output was a hex escape