diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrFoldTables.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrFoldTables.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86InstrFoldTables.cpp b/llvm/lib/Target/X86/X86InstrFoldTables.cpp index 27220a8d4d99..8aeb169929f2 100644 --- a/llvm/lib/Target/X86/X86InstrFoldTables.cpp +++ b/llvm/lib/Target/X86/X86InstrFoldTables.cpp @@ -13,6 +13,7 @@ #include "X86InstrFoldTables.h" #include "X86InstrInfo.h" #include "llvm/ADT/STLExtras.h" +#include <atomic> #include <vector> using namespace llvm; @@ -6102,7 +6103,7 @@ llvm::lookupFoldTable(unsigned RegOp, unsigned OpNum) { namespace { // This class stores the memory unfolding tables. It is instantiated as a -// ManagedStatic to lazily init the unfolding table. +// function scope static variable to lazily init the unfolding table. struct X86MemUnfoldTable { // Stores memory unfolding tables entries sorted by opcode. std::vector<X86MemoryFoldTableEntry> Table; @@ -6159,11 +6160,10 @@ struct X86MemUnfoldTable { }; } -static ManagedStatic<X86MemUnfoldTable> MemUnfoldTable; - const X86MemoryFoldTableEntry * llvm::lookupUnfoldTable(unsigned MemOp) { - auto &Table = MemUnfoldTable->Table; + static X86MemUnfoldTable MemUnfoldTable; + auto &Table = MemUnfoldTable.Table; auto I = llvm::lower_bound(Table, MemOp); if (I != Table.end() && I->KeyOp == MemOp) return &*I; |
