Skip to content

Commit

Permalink
[MIR] Add hasWinCFI field
Browse files Browse the repository at this point in the history
Adding hasWinCFI field so that I can add MIR test cases to
https://reviews.llvm.org/D50166.

Differential Revision: https://reviews.llvm.org/D51201

llvm-svn: 345196
  • Loading branch information
Sanjin Sijaric committed Oct 24, 2018
1 parent a0d18b6 commit 625d08e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/include/llvm/CodeGen/MIRYamlMapping.h
Expand Up @@ -494,6 +494,7 @@ struct MachineFunction {
bool FailedISel = false;
// Register information
bool TracksRegLiveness = false;
bool HasWinCFI = false;
std::vector<VirtualRegisterDefinition> VirtualRegisters;
std::vector<MachineFunctionLiveIn> LiveIns;
Optional<std::vector<FlowStringValue>> CalleeSavedRegisters;
Expand All @@ -517,6 +518,7 @@ template <> struct MappingTraits<MachineFunction> {
YamlIO.mapOptional("selected", MF.Selected, false);
YamlIO.mapOptional("failedISel", MF.FailedISel, false);
YamlIO.mapOptional("tracksRegLiveness", MF.TracksRegLiveness, false);
YamlIO.mapOptional("hasWinCFI", MF.HasWinCFI, false);
YamlIO.mapOptional("registers", MF.VirtualRegisters,
std::vector<VirtualRegisterDefinition>());
YamlIO.mapOptional("liveins", MF.LiveIns,
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/MIRParser/MIRParser.cpp
Expand Up @@ -355,6 +355,7 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF,
if (YamlMF.Alignment)
MF.setAlignment(YamlMF.Alignment);
MF.setExposesReturnsTwice(YamlMF.ExposesReturnsTwice);
MF.setHasWinCFI(YamlMF.HasWinCFI);

if (YamlMF.Legalized)
MF.getProperties().set(MachineFunctionProperties::Property::Legalized);
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/MIRPrinter.cpp
Expand Up @@ -196,6 +196,7 @@ void MIRPrinter::print(const MachineFunction &MF) {
YamlMF.Name = MF.getName();
YamlMF.Alignment = MF.getAlignment();
YamlMF.ExposesReturnsTwice = MF.exposesReturnsTwice();
YamlMF.HasWinCFI = MF.hasWinCFI();

YamlMF.Legalized = MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Legalized);
Expand Down

0 comments on commit 625d08e

Please sign in to comment.