diff options
author | Lang Hames <lhames@gmail.com> | 2009-11-08 08:49:59 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2009-11-08 08:49:59 +0000 |
commit | 16dcaf59960d699735a57b1623092d561c18a165 (patch) | |
tree | 0b3390b15ff788ba77b50a0086c8c954ca22141e /lib/CodeGen/SlotIndexes.cpp | |
parent | ce306a450fd7902501c4df5dd70350ff1d2a606e (diff) | |
download | llvm-16dcaf59960d699735a57b1623092d561c18a165.tar.gz llvm-16dcaf59960d699735a57b1623092d561c18a165.tar.bz2 llvm-16dcaf59960d699735a57b1623092d561c18a165.tar.xz |
Moved some ManagedStatics out of the SlotIndexes header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SlotIndexes.cpp')
-rw-r--r-- | lib/CodeGen/SlotIndexes.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp index d99d120509..9519114b5a 100644 --- a/lib/CodeGen/SlotIndexes.cpp +++ b/lib/CodeGen/SlotIndexes.cpp @@ -13,17 +13,43 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/ManagedStatic.h" using namespace llvm; // Yep - these are thread safe. See the header for details. -ManagedStatic<EmptyIndexListEntry> IndexListEntry::emptyKeyEntry; -ManagedStatic<TombstoneIndexListEntry> IndexListEntry::tombstoneKeyEntry; +namespace { + + + class EmptyIndexListEntry : public IndexListEntry { + public: + EmptyIndexListEntry() : IndexListEntry(EMPTY_KEY) {} + }; + + class TombstoneIndexListEntry : public IndexListEntry { + public: + TombstoneIndexListEntry() : IndexListEntry(TOMBSTONE_KEY) {} + }; + + // The following statics are thread safe. They're read only, and you + // can't step from them to any other list entries. + ManagedStatic<EmptyIndexListEntry> IndexListEntryEmptyKey; + ManagedStatic<TombstoneIndexListEntry> IndexListEntryTombstoneKey; +} char SlotIndexes::ID = 0; static RegisterPass<SlotIndexes> X("slotindexes", "Slot index numbering"); +IndexListEntry* IndexListEntry::getEmptyKeyEntry() { + return &*IndexListEntryEmptyKey; +} + +IndexListEntry* IndexListEntry::getTombstoneKeyEntry() { + return &*IndexListEntryTombstoneKey; +} + + void SlotIndexes::getAnalysisUsage(AnalysisUsage &au) const { au.setPreservesAll(); MachineFunctionPass::getAnalysisUsage(au); |