Fix build bot failures.

Unfortunately, not all compilers allow using llvm_unreachable
in a constexpr function.
This commit is contained in:
Igor Kudrin 2020-01-23 13:06:03 +07:00
parent 1b15965932
commit 15ac727714
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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