MIR Serialization: Serialize the jump table index operands.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-07-15 23:38:35 +00:00
parent 81bef8c7a7
commit a2e819fb09
8 changed files with 233 additions and 6 deletions

View File

@@ -113,7 +113,7 @@ public:
bool initializeJumpTableInfo(MachineFunction &MF,
const yaml::MachineJumpTable &YamlJTI,
const PerFunctionMIParsingState &PFS);
PerFunctionMIParsingState &PFS);
private:
/// Return a MIR diagnostic converted from an MI string diagnostic.
@@ -436,7 +436,7 @@ bool MIRParserImpl::initializeFrameInfo(const Function &F,
bool MIRParserImpl::initializeJumpTableInfo(
MachineFunction &MF, const yaml::MachineJumpTable &YamlJTI,
const PerFunctionMIParsingState &PFS) {
PerFunctionMIParsingState &PFS) {
MachineJumpTableInfo *JTI = MF.getOrCreateJumpTableInfo(YamlJTI.Kind);
SMDiagnostic Error;
for (const auto &Entry : YamlJTI.Entries) {
@@ -447,7 +447,9 @@ bool MIRParserImpl::initializeJumpTableInfo(
return error(Error, MBBSource.SourceRange);
Blocks.push_back(MBB);
}
JTI->createJumpTableIndex(Blocks);
unsigned Index = JTI->createJumpTableIndex(Blocks);
// TODO: Report an error when the same jump table slot ID is redefined.
PFS.JumpTableSlots.insert(std::make_pair(Entry.ID, Index));
}
return false;
}