[PATCH] D42848: Correct dwarf unwind information in function epilogue

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 09:26:07 PST 2018


thegameg requested changes to this revision.
thegameg added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:81
+  /// blocks.
+  std::vector<struct MBBCFAInfo> MBBVector;
+
----------------
No need for `struct` here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:89
+  /// the same.
+  void calculateOutgoingCFAInfo(struct MBBCFAInfo &MBBInfo);
+  /// Update in/out cfa offset and register values for successors of the basic
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:92
+  /// block.
+  void updateSuccCFAInfo(struct MBBCFAInfo &MBBInfo);
+
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:106
+
+  void report(const struct MBBCFAInfo &Pred, const struct MBBCFAInfo &Succ);
+  /// Go through each MBB in a function and check that outgoing offset and
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:133
+  for (MachineBasicBlock &MBB : MF) {
+    struct MBBCFAInfo MBBInfo;
+    MBBInfo.MBB = &MBB;
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:153
+
+void CFIInstrInserter::calculateOutgoingCFAInfo(struct MBBCFAInfo &MBBInfo) {
+  // Outgoing cfa offset set by the block.
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:217
+
+void CFIInstrInserter::updateSuccCFAInfo(struct MBBCFAInfo &MBBInfo) {
+  for (MachineBasicBlock *Succ : MBBInfo.MBB->successors()) {
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:219
+  for (MachineBasicBlock *Succ : MBBInfo.MBB->successors()) {
+    struct MBBCFAInfo &SuccInfo = MBBVector[Succ->getNumber()];
+    if (SuccInfo.Processed) continue;
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:229
+bool CFIInstrInserter::insertCFIInstrs(MachineFunction &MF) {
+  const struct MBBCFAInfo *PrevMBBInfo = &MBBVector[MF.front().getNumber()];
+  const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo();
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:237
+
+    const struct MBBCFAInfo &MBBInfo = MBBVector[MBB.getNumber()];
+    auto MBBI = MBBInfo.MBB->begin();
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:278
+
+void CFIInstrInserter::report(const struct MBBCFAInfo &Pred,
+                              const struct MBBCFAInfo &Succ) {
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:279
+void CFIInstrInserter::report(const struct MBBCFAInfo &Pred,
+                              const struct MBBCFAInfo &Succ) {
+  errs() << "*** Inconsistent CFA register and/or offset between pred and succ "
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:295
+  for (MachineBasicBlock &CurrMBB : MF) {
+    const struct MBBCFAInfo &CurrMBBInfo = MBBVector[CurrMBB.getNumber()];
+    for (MachineBasicBlock *Succ : CurrMBB.successors()) {
----------------
And here.


================
Comment at: lib/CodeGen/CFIInstrInserter.cpp:297
+    for (MachineBasicBlock *Succ : CurrMBB.successors()) {
+      const struct MBBCFAInfo &SuccMBBInfo = MBBVector[Succ->getNumber()];
+      // Check that incoming offset and register values of successors match the
----------------
And here.


Repository:
  rL LLVM

https://reviews.llvm.org/D42848





More information about the llvm-commits mailing list