summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-11-12 20:25:07 +0000
committerDavid Greene <greened@obbligato.org>2009-11-12 20:25:07 +0000
commit81eb42d8caf4aacfc126504953e73f7b646c7b67 (patch)
tree91820663e291191ab8ffdc6acee41ab91956ad1a /llvm/lib/CodeGen/PseudoSourceValue.cpp
parent815863f15736303bf052ac5c9dcece9062a4fc78 (diff)
downloadbcm5719-llvm-81eb42d8caf4aacfc126504953e73f7b646c7b67.tar.gz
bcm5719-llvm-81eb42d8caf4aacfc126504953e73f7b646c7b67.zip
Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by
making it visible to clients and adding LLVM-style cast capability. This will be used by AsmPrinter to determine when to emit spill comments for an instruction. llvm-svn: 87019
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--llvm/lib/CodeGen/PseudoSourceValue.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp
index 5507646878c..e95f017fc39 100644
--- a/llvm/lib/CodeGen/PseudoSourceValue.cpp
+++ b/llvm/lib/CodeGen/PseudoSourceValue.cpp
@@ -43,35 +43,14 @@ static const char *const PSVNames[] = {
// Eventually these should be uniqued on LLVMContext rather than in a managed
// static. For now, we can safely use the global context for the time being to
// squeak by.
-PseudoSourceValue::PseudoSourceValue() :
+PseudoSourceValue::PseudoSourceValue(enum ValueTy Subclass) :
Value(Type::getInt8PtrTy(getGlobalContext()),
- PseudoSourceValueVal) {}
+ Subclass) {}
void PseudoSourceValue::printCustom(raw_ostream &O) const {
O << PSVNames[this - *PSVs];
}
-namespace {
- /// FixedStackPseudoSourceValue - A specialized PseudoSourceValue
- /// for holding FixedStack values, which must include a frame
- /// index.
- class FixedStackPseudoSourceValue : public PseudoSourceValue {
- const int FI;
- public:
- explicit FixedStackPseudoSourceValue(int fi) : FI(fi) {}
-
- virtual bool isConstant(const MachineFrameInfo *MFI) const;
-
- virtual bool isAliased(const MachineFrameInfo *MFI) const;
-
- virtual bool mayAlias(const MachineFrameInfo *) const;
-
- virtual void printCustom(raw_ostream &OS) const {
- OS << "FixedStack" << FI;
- }
- };
-}
-
static ManagedStatic<std::map<int, const PseudoSourceValue *> > FSValues;
const PseudoSourceValue *PseudoSourceValue::getFixedStack(int FI) {
OpenPOWER on IntegriCloud