summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 624ec29)
raw | patch | inline | side by side (parent: 624ec29)
author | Hans Wennborg <hans@hanshq.net> | |
Mon, 18 Mar 2013 17:03:05 +0000 (17:03 +0000) | ||
committer | Hans Wennborg <hans@hanshq.net> | |
Mon, 18 Mar 2013 17:03:05 +0000 (17:03 +0000) |
The always-true "(int)Int == (signed)Int" comparison was found
while experimenting with a potential new Clang warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177290 91177308-0d34-0410-b5e6-96231b3b80d8
while experimenting with a potential new Clang warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177290 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DIE.h | patch | blob | history |
index 9907b01ceb6a97befcd36e0ad4b72c1a1fca04ce..d087c540f2c4b831b9ee310c966ce9e5626683c8 100644 (file)
///
static unsigned BestForm(bool IsSigned, uint64_t Int) {
if (IsSigned) {
- if ((char)Int == (signed)Int) return dwarf::DW_FORM_data1;
- if ((short)Int == (signed)Int) return dwarf::DW_FORM_data2;
- if ((int)Int == (signed)Int) return dwarf::DW_FORM_data4;
+ const int64_t SignedInt = Int;
+ if ((char)Int == SignedInt) return dwarf::DW_FORM_data1;
+ if ((short)Int == SignedInt) return dwarf::DW_FORM_data2;
+ if ((int)Int == SignedInt) return dwarf::DW_FORM_data4;
} else {
if ((unsigned char)Int == Int) return dwarf::DW_FORM_data1;
if ((unsigned short)Int == Int) return dwarf::DW_FORM_data2;