[llvm] r304095 - [TableGen][X86] Replace a global std::vector with a regular array. llvm::find works on arrays, just need to use std::end to check the result.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 11:24:33 PDT 2017


Author: ctopper
Date: Sun May 28 13:24:32 2017
New Revision: 304095

URL: http://llvm.org/viewvc/llvm-project?rev=304095&view=rev
Log:
[TableGen][X86] Replace a global std::vector with a regular array. llvm::find works on arrays, just need to use std::end to check the result.

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

Modified: llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp?rev=304095&r1=304094&r2=304095&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp Sun May 28 13:24:32 2017
@@ -73,7 +73,7 @@ const ManualMapEntry ManualMapSet[] = {
 };
 
 // Do not add these instructions to any of the folding tables.
-const std::vector<const char *> NoFoldSet = {
+const char *const NoFoldSet[] = {
     "TCRETURNri64",
     "TCRETURNmi64", // Special dealing (in X86InstrCompiler.td under
     "TCRETURNri",   // "tailcall stuff" section).
@@ -645,7 +645,7 @@ void X86FoldTablesEmitter::run(raw_ostre
     //   class ptr_rc_tailcall, which can be of a size 32 or 64, to ensure
     //   safe mapping of these instruction we manually map them and exclude
     //   them from the automation.
-    if (find(NoFoldSet, Rec->getName().str()) != NoFoldSet.end() ||
+    if (find(NoFoldSet, Rec->getName().str()) != std::end(NoFoldSet) ||
         hasRSTRegClass(Inst) || hasPtrTailcallRegClass(Inst))
       continue;
 




More information about the llvm-commits mailing list