summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/CodeGen/MachineFunction.h4
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp4
-rw-r--r--llvm/lib/CodeGen/MachineFunctionPass.cpp2
3 files changed, 7 insertions, 3 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h
index 515391e92f4..36cf6b50b7b 100644
--- a/llvm/include/llvm/CodeGen/MachineFunction.h
+++ b/llvm/include/llvm/CodeGen/MachineFunction.h
@@ -148,7 +148,9 @@ public:
return !V.Properties.test(Properties);
}
- void print(raw_ostream &ROS) const;
+ // Print the MachineFunctionProperties in human-readable form. If OnlySet is
+ // true, only print the properties that are set.
+ void print(raw_ostream &ROS, bool OnlySet=false) const;
private:
BitVector Properties =
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index da6b778cc6c..641ec74fc99 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -54,11 +54,13 @@ static cl::opt<unsigned>
void MachineFunctionInitializer::anchor() {}
-void MachineFunctionProperties::print(raw_ostream &ROS) const {
+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)
for (BitVector::size_type i = 0; i < Properties.size(); ++i) {
bool HasProperty = Properties[i];
+ if (OnlySet && !HasProperty)
+ continue;
switch(static_cast<Property>(i)) {
case Property::IsSSA:
ROS << (HasProperty ? "SSA, " : "Post SSA, ");
diff --git a/llvm/lib/CodeGen/MachineFunctionPass.cpp b/llvm/lib/CodeGen/MachineFunctionPass.cpp
index f6cb36e1a20..16aecb9dff4 100644
--- a/llvm/lib/CodeGen/MachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/MachineFunctionPass.cpp
@@ -49,7 +49,7 @@ bool MachineFunctionPass::runOnFunction(Function &F) {
errs() << "MachineFunctionProperties required by " << getPassName()
<< " pass are not met by function " << F.getName() << ".\n"
<< "Required properties: ";
- RequiredProperties.print(errs());
+ RequiredProperties.print(errs(), /*OnlySet=*/true);
errs() << "\nCurrent properties: ";
MFProps.print(errs());
errs() << "\n";
OpenPOWER on IntegriCloud