summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-01-30 23:47:44 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-01-30 23:47:44 +0000
commit2c469ff14aa2440a3d105d8a8c07ddd5bd936f65 (patch)
tree43910b26b3dd566f41c40cd854512d98c617dd40 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parentc93fa98e4c10ee948d05ddbe73117eff6b03b8e5 (diff)
downloadbcm5719-llvm-2c469ff14aa2440a3d105d8a8c07ddd5bd936f65.tar.gz
bcm5719-llvm-2c469ff14aa2440a3d105d8a8c07ddd5bd936f65.zip
Chris's constant data sequence refactoring actually enabled printing
vectors of all one bits to be printed more cleverly in the AsmPrinter. Unfortunately, the byte value for all one bits is the same with -fsigned-char as the error return of '-1'. Force this to be the unsigned byte value when returning it to avoid this problem, and update the test case for the shiny new behavior. Yay for building LLVM and Clang with -funsigned-char. Chris, please review, and let me know if there is any reason to not desire this change. It seems good on the surface, and certainly intended based on the code written. llvm-svn: 149299
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 78f3f1d32a7..1e55de4494c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1558,7 +1558,7 @@ static int isRepeatedByteSequence(const ConstantDataSequential *V) {
char C = Data[0];
for (unsigned i = 1, e = Data.size(); i != e; ++i)
if (Data[i] != C) return -1;
- return C;
+ return static_cast<uint8_t>(C); // Ensure 255 is not returned as -1.
}
OpenPOWER on IntegriCloud