[PATCH] D144999: [RFC][MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 12:55:03 PST 2023


jyknight added inline comments.


================
Comment at: llvm/include/llvm/MC/MCDwarf.h:701
+  // __gxx_personality_v0, __gcc_personality_v0,__objc_personality_v0.
+  bool IsCanonicalPersonality = false;
 };
----------------
This is an Apple compact-unwind-specific predicate, so needs to be named as such.

Although, I think with the other change I suggest, we don't need to add a bool at all, we can just check as needed in generateCompactUnwindEncoding.


================
Comment at: llvm/lib/MC/MCDwarf.cpp:1867
     for (const MCDwarfFrameInfo &Frame : FrameArray) {
-      if (Frame.CompactUnwindEncoding == 0) continue;
+      if (Frame.CompactUnwindEncoding == 0 || !Frame.IsCanonicalPersonality)
+        continue;
----------------
I think the check for whether the function is a canonical personality-function should be done inside each architecture's `generateCompactUnwindEncoding` (which means passing FI.Personality to it from `generateCompactUnwindEncodings`). I'd stick the check right after the initial "if(X) return 0" clauses.

That would allow the rest of the changes in this file to be reverted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144999/new/

https://reviews.llvm.org/D144999



More information about the llvm-commits mailing list