Skip to content

Commit

Permalink
[PPC64] Remove support for ELF V1 ABI in LLD - buildbot fix
Browse files Browse the repository at this point in the history
Fix buildbot error, failure to build with msvc due to error C2446
Use switch instead of ternary operator.

Differential Revision: https://reviews.llvm.org/D46316

llvm-svn: 331534
  • Loading branch information
syzaara committed May 4, 2018
1 parent 425f48d commit edc7a8c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lld/ELF/Arch/PPC64.cpp
Expand Up @@ -97,10 +97,17 @@ PPC64::PPC64() {
static uint32_t getEFlags(InputFile *File) {
// Get the e_flag from the input file and issue an error if incompatible
// e_flag encountered.

uint32_t EFlags = Config->IsLE ?
cast<ObjFile<ELF64LE>>(File)->getObj().getHeader()->e_flags :
cast<ObjFile<ELF64BE>>(File)->getObj().getHeader()->e_flags;
uint32_t EFlags;
switch (Config->EKind) {
case ELF64BEKind:
EFlags = cast<ObjFile<ELF64BE>>(File)->getObj().getHeader()->e_flags;
break;
case ELF64LEKind:
EFlags = cast<ObjFile<ELF64LE>>(File)->getObj().getHeader()->e_flags;
break;
default:
llvm_unreachable("unknown Config->EKind");
}
if (EFlags > 2) {
error("incompatible e_flags: " + toString(File));
return 0;
Expand Down

0 comments on commit edc7a8c

Please sign in to comment.