[lld] r331534 - [PPC64] Remove support for ELF V1 ABI in LLD - buildbot fix
Zaara Syeda via llvm-commits
llvm-commits at lists.llvm.org
Fri May 4 09:04:04 PDT 2018
Author: syzaara
Date: Fri May 4 09:04:04 2018
New Revision: 331534
URL: http://llvm.org/viewvc/llvm-project?rev=331534&view=rev
Log:
[PPC64] Remove support for ELF V1 ABI in LLD - buildbot fix
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
Modified:
lld/trunk/ELF/Arch/PPC64.cpp
Modified: lld/trunk/ELF/Arch/PPC64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/PPC64.cpp?rev=331534&r1=331533&r2=331534&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/PPC64.cpp (original)
+++ lld/trunk/ELF/Arch/PPC64.cpp Fri May 4 09:04:04 2018
@@ -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;
More information about the llvm-commits
mailing list