summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-06-30 18:16:42 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-06-30 18:16:42 +0000
commitf09df00daad64a809204cd12ed47c3d81e25652d (patch)
tree1343916e5f3598b76af7b47929ccffb6e98943d5 /llvm/lib/CodeGen/MIRPrinter.cpp
parent5b03e1ada8312e1aff57b829b7c328b85fcb7b0f (diff)
downloadbcm5719-llvm-f09df00daad64a809204cd12ed47c3d81e25652d.tar.gz
bcm5719-llvm-f09df00daad64a809204cd12ed47c3d81e25652d.zip
MIR Serialization: Serialize MBB successors.
This commit implements serialization of the machine basic block successors. It uses a YAML flow sequence that contains strings that have the MBB references. The MBB references in those strings use the same syntax as the MBB machine operands in the machine instruction strings. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10699 llvm-svn: 241093
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 18c976bcd3e..6b6675579cc 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -131,6 +131,12 @@ void MIRPrinter::convert(const Module &M, yaml::MachineBasicBlock &YamlMBB,
YamlMBB.Alignment = MBB.getAlignment();
YamlMBB.AddressTaken = MBB.hasAddressTaken();
YamlMBB.IsLandingPad = MBB.isLandingPad();
+ for (const auto *MBB : MBB.successors()) {
+ std::string Str;
+ raw_string_ostream StrOS(Str);
+ MIPrinter(M, StrOS, RegisterMaskIds).printMBBReference(*MBB);
+ YamlMBB.Successors.push_back(StrOS.str());
+ }
// Print the machine instructions.
YamlMBB.Instructions.reserve(MBB.size());
OpenPOWER on IntegriCloud