This is an archive of the discontinued LLVM Phabricator instance.

Add a dump method to MachineFunctionProperties for better error messages
ClosedPublic

Authored by dschuff on Mar 28 2016, 4:00 PM.

Details

Summary

This makes check failures much easier to understand.
Make it empty (but leave it in the class) for NDEBUG builds.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 51849.Mar 28 2016, 4:00 PM
dschuff retitled this revision from to Add a dump method to MachineFunctionProperties for better error messages.
dschuff updated this object.
dschuff added a reviewer: qcolombet.
dschuff added a subscriber: llvm-commits.
dschuff updated this revision to Diff 51856.Mar 28 2016, 4:52 PM
  • Also print the properties when printing the MF
qcolombet added inline comments.Mar 29 2016, 10:26 AM
include/llvm/CodeGen/MachineFunction.h
146 ↗(On Diff #51856)

Short story, rename dump -> print.

The convention is to have dump to be available only in debug build, but more importantly to have it to print on dbgs().
What we want here is a print method.

lib/CodeGen/MachineFunction.cpp
396 ↗(On Diff #51856)

print calls print, not dump.

dschuff updated this revision to Diff 51949.Mar 29 2016, 10:40 AM
dschuff marked 2 inline comments as done.
  • Also print the properties when printing the MF
  • Rename dump->print
qcolombet accepted this revision.Mar 29 2016, 11:54 AM
qcolombet edited edge metadata.
This revision is now accepted and ready to land.Mar 29 2016, 11:54 AM
This revision was automatically updated to reflect the committed changes.