summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2016-08-02 14:42:57 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2016-08-02 14:42:57 +0000
commitc8454a77c18f9e70ca19aa1bcbbe2dce1dc133f4 (patch)
tree0f7065a158fa933d0074845b450fe5c1faa1149e /llvm/lib/CodeGen/MachineFunction.cpp
parented581eac6acca8048124f2e51d68e92f7c1d934b (diff)
downloadbcm5719-llvm-c8454a77c18f9e70ca19aa1bcbbe2dce1dc133f4.tar.gz
bcm5719-llvm-c8454a77c18f9e70ca19aa1bcbbe2dce1dc133f4.zip
[CodeGen] Generalize MachineFunctionProperties::print comma handling.
This is only used for debug prints, but the previous hardcoded ", " caused it to be printed unnecessarily when OnlySet, and is annoying when adding new properties. llvm-svn: 277465
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index a7c63ef4c85..a4c4ea4bb95 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -57,16 +57,21 @@ void MachineFunctionInitializer::anchor() {}
void MachineFunctionProperties::print(raw_ostream &ROS, bool OnlySet) const {
// Leave this function even in NDEBUG as an out-of-line anchor.
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+ bool NeedsComma = false;
for (BitVector::size_type i = 0; i < Properties.size(); ++i) {
bool HasProperty = Properties[i];
if (OnlySet && !HasProperty)
continue;
+ if (NeedsComma)
+ ROS << ", ";
+ else
+ NeedsComma = true;
switch(static_cast<Property>(i)) {
case Property::IsSSA:
- ROS << (HasProperty ? "SSA, " : "Post SSA, ");
+ ROS << (HasProperty ? "SSA" : "Post SSA");
break;
case Property::TracksLiveness:
- ROS << (HasProperty ? "" : "not ") << "tracking liveness, ";
+ ROS << (HasProperty ? "" : "not ") << "tracking liveness";
break;
case Property::AllVRegsAllocated:
ROS << (HasProperty ? "AllVRegsAllocated" : "HasVRegs");
OpenPOWER on IntegriCloud