mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-22 03:28:35 +00:00
Silence warnings and simplify code. Eliminate a 32/64 bit portability issue.
llvm-svn: 111201
This commit is contained in:
parent
72106f71dc
commit
70e0faed21
@ -545,14 +545,13 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user