[llvm] r323659 - [AccelTable] Try making MSVC happy
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 07:23:34 PST 2018
Author: jdevlieghere
Date: Mon Jan 29 07:23:34 2018
New Revision: 323659
URL: http://llvm.org/viewvc/llvm-project?rev=323659&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/CodeGen/AccelTable.h
llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AccelTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AccelTable.h?rev=323659&r1=323658&r2=323659&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AccelTable.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AccelTable.h Mon Jan 29 07:23:34 2018
@@ -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),
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp?rev=323659&r1=323658&r2=323659&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp Mon Jan 29 07:23:34 2018
@@ -70,10 +70,10 @@ void AppleAccelTableHeader::setBucketAnd
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); }
More information about the llvm-commits
mailing list