From ba8daf0964c74ec394e905cc07ca3042360b51bf Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 29 Jan 2018 15:23:34 +0000 Subject: [PATCH] [AccelTable] Try making MSVC happy MSVC complains that the constexpr "expression did not evaluate to a constant". Trying to make it happy by adding a `const` specifier as suggested in https://stackoverflow.com/questions/37574343. llvm-svn: 323659 --- llvm/include/llvm/CodeGen/AccelTable.h | 8 ++++---- llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/CodeGen/AccelTable.h b/llvm/include/llvm/CodeGen/AccelTable.h index 27b78636403a..f3db36c395e4 100644 --- a/llvm/include/llvm/CodeGen/AccelTable.h +++ b/llvm/include/llvm/CodeGen/AccelTable.h @@ -368,7 +368,7 @@ public: void emit(AsmPrinter *Asm) const override; - static constexpr AppleAccelTableHeader::Atom Atoms[] = { + static constexpr const AppleAccelTableHeader::Atom Atoms[] = { AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)}; @@ -391,7 +391,7 @@ public: void emit(AsmPrinter *Asm) const override; - static constexpr AppleAccelTableHeader::Atom Atoms[] = { + static constexpr const AppleAccelTableHeader::Atom Atoms[] = { AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4), AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2), @@ -414,7 +414,7 @@ public: void emit(AsmPrinter *Asm) const override; - static constexpr AppleAccelTableHeader::Atom Atoms[] = { + static constexpr const AppleAccelTableHeader::Atom Atoms[] = { AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)}; @@ -443,7 +443,7 @@ public: void emit(AsmPrinter *Asm) const override; - static constexpr AppleAccelTableHeader::Atom Atoms[] = { + static constexpr const AppleAccelTableHeader::Atom Atoms[] = { AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4), AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2), diff --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp index 5c80206a1d7e..597c2e7f33e2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp @@ -70,10 +70,10 @@ void AppleAccelTableHeader::setBucketAndHashCount(uint32_t HashCount) { Header.HashCount = HashCount; } -constexpr AppleAccelTableHeader::Atom AppleAccelTableTypeData::Atoms[]; -constexpr AppleAccelTableHeader::Atom AppleAccelTableOffsetData::Atoms[]; -constexpr AppleAccelTableHeader::Atom AppleAccelTableStaticOffsetData::Atoms[]; -constexpr AppleAccelTableHeader::Atom AppleAccelTableStaticTypeData::Atoms[]; +constexpr const AppleAccelTableHeader::Atom AppleAccelTableTypeData::Atoms[]; +constexpr const AppleAccelTableHeader::Atom AppleAccelTableOffsetData::Atoms[]; +constexpr const AppleAccelTableHeader::Atom AppleAccelTableStaticOffsetData::Atoms[]; +constexpr const AppleAccelTableHeader::Atom AppleAccelTableStaticTypeData::Atoms[]; void AppleAccelTableBase::emitHeader(AsmPrinter *Asm) { Header.emit(Asm); }