mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
MIR Serialization: Serialize machine instruction names.
This commit implements initial machine instruction serialization. It serializes machine instruction names. The instructions are represented using a YAML sequence of string literals and are a part of machine basic block YAML mapping. This commit introduces a class called 'MIParser' which will be used to parse the machine instructions and operands. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240295 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
#include "llvm/Support/YAMLTraits.h"
|
||||
#include <vector>
|
||||
|
||||
LLVM_YAML_IS_SEQUENCE_VECTOR(std::string)
|
||||
|
||||
namespace llvm {
|
||||
namespace yaml {
|
||||
|
||||
@ -31,7 +33,8 @@ struct MachineBasicBlock {
|
||||
bool IsLandingPad = false;
|
||||
bool AddressTaken = false;
|
||||
// TODO: Serialize the successors and liveins.
|
||||
// TODO: Serialize machine instructions.
|
||||
|
||||
std::vector<std::string> Instructions;
|
||||
};
|
||||
|
||||
template <> struct MappingTraits<MachineBasicBlock> {
|
||||
@ -41,6 +44,7 @@ template <> struct MappingTraits<MachineBasicBlock> {
|
||||
YamlIO.mapOptional("alignment", MBB.Alignment);
|
||||
YamlIO.mapOptional("isLandingPad", MBB.IsLandingPad);
|
||||
YamlIO.mapOptional("addressTaken", MBB.AddressTaken);
|
||||
YamlIO.mapOptional("instructions", MBB.Instructions);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user