summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CWriter/Writer.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
commit6077c3195f74b27b75ed3e9df3af7a13798b437f (patch)
tree48a5a2e54b7d1a5762d782e838db817d8a2e78ca /llvm/lib/CWriter/Writer.cpp
parent79f22fe02fe354c50fc4d6a1c08a894fdd847dba (diff)
downloadbcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.tar.gz
bcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.zip
Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting llvm-svn: 7252
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
-rw-r--r--llvm/lib/CWriter/Writer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp
index 6d6f145b92a..c15c23e3695 100644
--- a/llvm/lib/CWriter/Writer.cpp
+++ b/llvm/lib/CWriter/Writer.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
OpenPOWER on IntegriCloud