MIR Serialization: Print and parse simple machine function attributes.

This commit serializes the simple, scalar attributes from the 
'MachineFunction' class.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10449


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239790 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-06-16 00:10:47 +00:00
parent b3607cdd97
commit 00b6413c97
4 changed files with 48 additions and 0 deletions

View File

@ -26,11 +26,17 @@ namespace yaml {
struct MachineFunction {
StringRef Name;
unsigned Alignment;
bool ExposesReturnsTwice;
bool HasInlineAsm;
};
template <> struct MappingTraits<MachineFunction> {
static void mapping(IO &YamlIO, MachineFunction &MF) {
YamlIO.mapRequired("name", MF.Name);
YamlIO.mapOptional("alignment", MF.Alignment);
YamlIO.mapOptional("exposesReturnsTwice", MF.ExposesReturnsTwice);
YamlIO.mapOptional("hasInlineAsm", MF.HasInlineAsm);
}
};