[llvm] 15ac727 - Fix build bot failures.
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 22:14:39 PST 2020
Author: Igor Kudrin
Date: 2020-01-23T13:14:21+07:00
New Revision: 15ac72771430743f69da4d2848e6cf081c3df53a
URL: https://github.com/llvm/llvm-project/commit/15ac72771430743f69da4d2848e6cf081c3df53a
DIFF: https://github.com/llvm/llvm-project/commit/15ac72771430743f69da4d2848e6cf081c3df53a.diff
LOG: Fix build bot failures.
Unfortunately, not all compilers allow using llvm_unreachable
in a constexpr function.
Added:
Modified:
llvm/include/llvm/BinaryFormat/Dwarf.h
llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/BinaryFormat/Dwarf.h b/llvm/include/llvm/BinaryFormat/Dwarf.h
index dab2db0c4c65..6195079c7ff5 100644
--- a/llvm/include/llvm/BinaryFormat/Dwarf.h
+++ b/llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -533,7 +533,7 @@ unsigned LanguageVendor(SourceLanguage L);
Optional<unsigned> LanguageLowerBound(SourceLanguage L);
/// The size of a reference determined by the DWARF 32/64-bit format.
-constexpr uint8_t getDwarfOffsetByteSize(DwarfFormat Format) {
+inline uint8_t getDwarfOffsetByteSize(DwarfFormat Format) {
switch (Format) {
case DwarfFormat::DWARF32:
return 4;
@@ -569,7 +569,7 @@ struct FormParams {
};
/// Get the byte size of the unit length field depending on the DWARF format.
-constexpr uint8_t getUnitLengthFieldByteSize(DwarfFormat Format) {
+inline uint8_t getUnitLengthFieldByteSize(DwarfFormat Format) {
switch (Format) {
case DwarfFormat::DWARF32:
return 4;
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
index 52005823d937..c4af6cf4d80d 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
@@ -62,10 +62,10 @@ Error DWARFDebugArangeSet::extract(DataExtractor data, uint64_t *offset_ptr) {
constexpr unsigned CommonFieldsLength = 2 + // Version
1 + // Address Size
1; // Segment Selector Size
- constexpr unsigned DWARF32HeaderLength =
+ static const unsigned DWARF32HeaderLength =
dwarf::getUnitLengthFieldByteSize(dwarf::DWARF32) + CommonFieldsLength +
dwarf::getDwarfOffsetByteSize(dwarf::DWARF32); // Debug Info Offset
- constexpr unsigned DWARF64HeaderLength =
+ static const unsigned DWARF64HeaderLength =
dwarf::getUnitLengthFieldByteSize(dwarf::DWARF64) + CommonFieldsLength +
dwarf::getDwarfOffsetByteSize(dwarf::DWARF64); // Debug Info Offset
More information about the llvm-commits
mailing list