]> granicus.if.org Git - llvm/commitdiff
[globalisel][tablegen] Ensure MatchTable's are compile-time constants with constexpr...
authorDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 27 Jul 2017 12:47:31 +0000 (12:47 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 27 Jul 2017 12:47:31 +0000 (12:47 +0000)
This should prevent any re-occurence of the problem where the table was
initialized at run-time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309267 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/GlobalISelEmitter.cpp

index 47f974ac5ed674b110e6622205cc9782547d35bd..9181272adc22d66107e17878b2dd30ea3b3343b0 100644 (file)
@@ -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, ' ');