[llvm] r309267 - [globalisel][tablegen] Ensure MatchTable's are compile-time constants with constexpr. NFC.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 05:47:31 PDT 2017


Author: dsanders
Date: Thu Jul 27 05:47:31 2017
New Revision: 309267

URL: http://llvm.org/viewvc/llvm-project?rev=309267&view=rev
Log:
[globalisel][tablegen] Ensure MatchTable's are compile-time constants with constexpr. NFC.

This should prevent any re-occurence of the problem where the table was
initialized at run-time.


Modified:
    llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp

Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=309267&r1=309266&r2=309267&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Thu Jul 27 05:47:31 2017
@@ -370,7 +370,7 @@ public:
 
   void emitDeclaration(raw_ostream &OS) const {
     unsigned Indentation = 4;
-    OS << "  const static int64_t MatchTable" << ID << "[] = {";
+    OS << "  constexpr static int64_t MatchTable" << ID << "[] = {";
     LineBreak.emit(OS, true, *this);
     OS << std::string(Indentation, ' ');
 




More information about the llvm-commits mailing list