aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-05-01 08:37:51 -0400
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-05-11 10:20:05 -0400
commit33b69b97565cf19f8e11173fd851e56ce07656f0 (patch)
tree9121ec8827dbc4e74899d851db2fd96d804dbdc3 /llvm/lib/CodeGen/MIRPrinter.cpp
parent30093d6be2499995ea66b09b0c8569bf5dc3e950 (diff)
downloadllvm-33b69b97565cf19f8e11173fd851e56ce07656f0.zip
llvm-33b69b97565cf19f8e11173fd851e56ce07656f0.tar.gz
llvm-33b69b97565cf19f8e11173fd851e56ce07656f0.tar.bz2
[YamlMF] Serialize EntryValueObjects
This commit implements the serialization and deserialization of the Machine Function's EntryValueObjects. Depends on D149879, D149778 Differential Revision: https://reviews.llvm.org/D149880
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 8326d83..8b68b1e 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -119,6 +119,9 @@ public:
const MachineJumpTableInfo &JTI);
void convertStackObjects(yaml::MachineFunction &YMF,
const MachineFunction &MF, ModuleSlotTracker &MST);
+ void convertEntryValueObjects(yaml::MachineFunction &YMF,
+ const MachineFunction &MF,
+ ModuleSlotTracker &MST);
void convertCallSiteObjects(yaml::MachineFunction &YMF,
const MachineFunction &MF,
ModuleSlotTracker &MST);
@@ -221,6 +224,7 @@ void MIRPrinter::print(const MachineFunction &MF) {
MST.incorporateFunction(MF.getFunction());
convert(MST, YamlMF.FrameInfo, MF.getFrameInfo());
convertStackObjects(YamlMF, MF, MST);
+ convertEntryValueObjects(YamlMF, MF, MST);
convertCallSiteObjects(YamlMF, MF, MST);
for (const auto &Sub : MF.DebugValueSubstitutions) {
const auto &SubSrc = Sub.Src;
@@ -373,6 +377,19 @@ void MIRPrinter::convert(ModuleSlotTracker &MST,
}
}
+void MIRPrinter::convertEntryValueObjects(yaml::MachineFunction &YMF,
+ const MachineFunction &MF,
+ ModuleSlotTracker &MST) {
+ const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
+ for (const MachineFunction::VariableDbgInfo &DebugVar :
+ MF.getEntryValueVariableDbgInfo()) {
+ yaml::EntryValueObject &Obj = YMF.EntryValueObjects.emplace_back();
+ printStackObjectDbgInfo(DebugVar, Obj, MST);
+ MCRegister EntryValReg = DebugVar.getEntryValueRegister();
+ printRegMIR(EntryValReg, Obj.EntryValueRegister, TRI);
+ }
+}
+
void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF,
const MachineFunction &MF,
ModuleSlotTracker &MST) {