[llvm] r365535 - Try to appease the Windows build bots.
Sean Fertile via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 11:44:29 PDT 2019
Author: sfertile
Date: Tue Jul 9 11:44:28 2019
New Revision: 365535
URL: http://llvm.org/viewvc/llvm-project?rev=365535&view=rev
Log:
Try to appease the Windows build bots.
Several of the conditonal operators commited in llvm-svn: 365524 fail to compile
on the windows buildbots. Converting to an if and early return to try to fix.
Modified:
llvm/trunk/lib/Object/XCOFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/XCOFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/XCOFFObjectFile.cpp?rev=365535&r1=365534&r2=365535&view=diff
==============================================================================
--- llvm/trunk/lib/Object/XCOFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/XCOFFObjectFile.cpp Tue Jul 9 11:44:28 2019
@@ -189,8 +189,12 @@ Expected<StringRef> XCOFFObjectFile::get
}
uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const {
- return is64Bit() ? toSection64(Sec)->VirtualAddress
- : toSection32(Sec)->VirtualAddress;
+ // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
+ // with MSVC.
+ if (is64Bit())
+ return toSection64(Sec)->VirtualAddress;
+
+ return toSection32(Sec)->VirtualAddress;
}
uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const {
@@ -203,8 +207,12 @@ uint64_t XCOFFObjectFile::getSectionInde
}
uint64_t XCOFFObjectFile::getSectionSize(DataRefImpl Sec) const {
- return is64Bit() ? toSection64(Sec)->SectionSize
- : toSection32(Sec)->SectionSize;
+ // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
+ // with MSVC.
+ if (is64Bit())
+ return toSection64(Sec)->SectionSize;
+
+ return toSection32(Sec)->SectionSize;
}
Expected<ArrayRef<uint8_t>>
More information about the llvm-commits
mailing list