summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index a8475d29827..52f9a1d27a6 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -57,20 +57,17 @@ void MachineFunctionInitializer::anchor() {}
void MachineFunctionProperties::print(raw_ostream &ROS) const {
// Leave this function even in NDEBUG as an out-of-line anchor.
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
- if (!Properties.any()) {
- ROS << "(empty)";
- return;
- }
for (BitVector::size_type i = 0; i < Properties.size(); ++i) {
- if (Properties[i]) {
- switch(static_cast<Property>(i)) {
- case Property::AllVRegsAllocated:
- ROS << "AllVRegsAllocated ";
- break;
- default:
- // TODO: Implement IsSSA/TracksLiveness when we make them properties.
- llvm_unreachable("Unexpected value for property enum");
- }
+ bool HasProperty = Properties[i];
+ switch(static_cast<Property>(i)) {
+ case Property::IsSSA:
+ ROS << (HasProperty ? "SSA, " : "Post SSA, ");
+ break;
+ case Property::AllVRegsAllocated:
+ ROS << (HasProperty ? "AllVRegsAllocated" : "HasVRegs");
+ break;
+ default:
+ break;
}
}
#endif
@@ -91,6 +88,8 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
unsigned FunctionNum, MachineModuleInfo &mmi)
: Fn(F), Target(TM), STI(TM.getSubtargetImpl(*F)), Ctx(mmi.getContext()),
MMI(mmi) {
+ // Assume the function starts in SSA form.
+ Properties.set(MachineFunctionProperties::Property::IsSSA);
if (STI->getRegisterInfo())
RegInfo = new (Allocator) MachineRegisterInfo(this);
else
@@ -396,9 +395,8 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
getProperties().print(OS);
OS << "> : ";
if (RegInfo) {
- OS << (RegInfo->isSSA() ? "SSA" : "Post SSA");
if (!RegInfo->tracksLiveness())
- OS << ", not tracking liveness";
+ OS << "not tracking liveness";
}
OS << '\n';
OpenPOWER on IntegriCloud