MIR Serialization: Serialize the unnamed basic block references.

This commit serializes the references from the machine basic blocks to the
unnamed basic blocks.

This commit adds a new attribute to the machine basic block's YAML mapping
called 'ir-block'. This attribute contains the actual reference to the
basic block.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-07-27 22:42:41 +00:00
parent 3f7b911196
commit 01b5d5b27f
10 changed files with 147 additions and 7 deletions

View File

@@ -135,6 +135,7 @@ template <> struct MappingTraits<MachineFunctionLiveIn> {
struct MachineBasicBlock {
unsigned ID;
StringValue Name;
StringValue IRBlock;
unsigned Alignment = 0;
bool IsLandingPad = false;
bool AddressTaken = false;
@@ -149,6 +150,8 @@ template <> struct MappingTraits<MachineBasicBlock> {
YamlIO.mapRequired("id", MBB.ID);
YamlIO.mapOptional("name", MBB.Name,
StringValue()); // Don't print out an empty name.
YamlIO.mapOptional("ir-block", MBB.IRBlock,
StringValue()); // Don't print out an empty BB reference.
YamlIO.mapOptional("alignment", MBB.Alignment);
YamlIO.mapOptional("isLandingPad", MBB.IsLandingPad);
YamlIO.mapOptional("addressTaken", MBB.AddressTaken);