summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorSean Fertile <sfertile@ca.ibm.com>2019-07-09 18:44:28 +0000
committerSean Fertile <sfertile@ca.ibm.com>2019-07-09 18:44:28 +0000
commit210314ae8c59bc0a8801c2528eda892cd5960c31 (patch)
treea1a0219cc73894f26dddb458775d07b2660afc4a /llvm/lib/Object
parent95176d72c7e8846e1382323b5e180f3f3d835b42 (diff)
downloadbcm5719-llvm-210314ae8c59bc0a8801c2528eda892cd5960c31.tar.gz
bcm5719-llvm-210314ae8c59bc0a8801c2528eda892cd5960c31.zip
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. llvm-svn: 365535
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index 0943970b1cc..602b7357986 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -189,8 +189,12 @@ Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const {
}
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::getSectionIndex(DataRefImpl Sec) const {
}
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>>
OpenPOWER on IntegriCloud