[llvm-commits] [llvm] r111201 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Aug 16 16:00:12 PDT 2010
Author: d0k
Date: Mon Aug 16 18:00:12 2010
New Revision: 111201
URL: http://llvm.org/viewvc/llvm-project?rev=111201&view=rev
Log:
Silence warnings and simplify code. Eliminate a 32/64 bit portability issue.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111201&r1=111200&r2=111201&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 18:00:12 2010
@@ -545,14 +545,13 @@
if (IsPCRel) {
Type = ELF::R_X86_64_PC32;
} else {
- switch (Fixup.getKind()) {
+ switch ((unsigned)Fixup.getKind()) {
+ default: llvm_unreachable("invalid fixup kind!");
case FK_Data_8: Type = ELF::R_X86_64_64; break;
case X86::reloc_pcrel_4byte:
case FK_Data_4:
- long Offset;
- Offset = Target.getConstant();
// check that the offset fits within a signed long
- if (!(((long) -1 << 31) & Offset) || (((long) -1 << 31) & Offset) == ((long) -1 << 31))
+ if (isInt<32>(Target.getConstant()))
Type = ELF::R_X86_64_32S;
else
Type = ELF::R_X86_64_32;
More information about the llvm-commits
mailing list