summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--lib/CodeGen/PseudoSourceValue.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp
index 00c5d46d21..289a52b62a 100644
--- a/lib/CodeGen/PseudoSourceValue.cpp
+++ b/lib/CodeGen/PseudoSourceValue.cpp
@@ -63,6 +63,8 @@ namespace {
virtual bool isConstant(const MachineFrameInfo *MFI) const;
+ virtual bool isAliased() const;
+
virtual void printCustom(raw_ostream &OS) const {
OS << "FixedStack" << FI;
}
@@ -89,6 +91,23 @@ bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const {
return false;
}
+bool PseudoSourceValue::isAliased() const {
+ if (this == getStack() ||
+ this == getGOT() ||
+ this == getConstantPool() ||
+ this == getJumpTable())
+ return false;
+ llvm_unreachable("Unknown PseudoSourceValue!");
+ return true;
+}
+
bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{
return MFI && MFI->isImmutableObjectIndex(FI);
}
+
+bool FixedStackPseudoSourceValue::isAliased() const{
+ // Negative frame indices are used for special things that don't
+ // appear in LLVM IR. Non-negative indices may be used for things
+ // like static allocas.
+ return FI >= 0;
+}