summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SlotIndexes.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-11-08 08:49:59 +0000
committerLang Hames <lhames@gmail.com>2009-11-08 08:49:59 +0000
commit09eeeaf08b293c3fc62c2cd434a455c207bd40e4 (patch)
treee91acc10bacb5a808d9d6d88bfb3a2993efa8981 /llvm/lib/CodeGen/SlotIndexes.cpp
parent99db7963b47cab962cc51c90f8af470c6f7f658f (diff)
downloadbcm5719-llvm-09eeeaf08b293c3fc62c2cd434a455c207bd40e4.tar.gz
bcm5719-llvm-09eeeaf08b293c3fc62c2cd434a455c207bd40e4.zip
Moved some ManagedStatics out of the SlotIndexes header.
llvm-svn: 86446
Diffstat (limited to 'llvm/lib/CodeGen/SlotIndexes.cpp')
-rw-r--r--llvm/lib/CodeGen/SlotIndexes.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp
index d99d120509d..9519114b5a3 100644
--- a/llvm/lib/CodeGen/SlotIndexes.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud