diff options
author | Matthias Braun <matze@braunis.de> | 2018-09-19 00:23:35 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2018-09-19 00:23:35 +0000 |
commit | 726e12cf0ce6c926877bd8e19e6afe05e5101eeb (patch) | |
tree | 3c51890e89c9edc54677dd95cf3939a1b50b6e8c /llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | |
parent | f6ccde781004295dc031b86ee1f19a367130db70 (diff) | |
download | bcm5719-llvm-726e12cf0ce6c926877bd8e19e6afe05e5101eeb.tar.gz bcm5719-llvm-726e12cf0ce6c926877bd8e19e6afe05e5101eeb.zip |
ScheduleDAG: Cleanup dumping code; NFC
- Instead of having both `SUnit::dump(ScheduleDAG*)` and
`ScheduleDAG::dumpNode(ScheduleDAG*)`, just keep the latter around.
- Add `ScheduleDAG::dump()` and avoid code duplication in several
places. Implement it for different ScheduleDAG variants.
- Add `ScheduleDAG::dumpNodeName()` in favor of the `SUnit::print()`
functions. They were only ever used for debug dumping and putting the
function into ScheduleDAG is consistent with the `dumpNode()` change.
llvm-svn: 342520
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp index d1c5ddabb97..5eb842eb04a 100644 --- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -1097,10 +1097,22 @@ void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) { } } -void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const { - // Cannot completely remove virtual function even in release mode. +void ScheduleDAGInstrs::dumpNode(const SUnit &SU) const { #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - SU->getInstr()->dump(); + dumpNodeName(SU); + dbgs() << ": "; + SU.getInstr()->dump(); +#endif +} + +void ScheduleDAGInstrs::dump() const { +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) + if (EntrySU.getInstr() != nullptr) + dumpNodeAll(EntrySU); + for (const SUnit &SU : SUnits) + dumpNodeAll(SU); + if (ExitSU.getInstr() != nullptr) + dumpNodeAll(ExitSU); #endif } |