mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-01 07:09:02 +00:00
Improve error message reporting for MachineFunctionProperties
When printing the properties required by a pass, only print the properties that are set, and not those that are clear (only properties that are set are verified, clear properties are "don't-care"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267070 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfbb8a788e
commit
4913b3f2cf
@ -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 =
|
||||
|
@ -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, ");
|
||||
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user