[PATCH] D146595: [clang] Add "transparent_stepping" attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 07:20:31 PDT 2023


aaron.ballman added a comment.

In D146595#4237228 <https://reviews.llvm.org/D146595#4237228>, @aprantl wrote:

> I think `debug_trampoline` both captures the semantics and makes it clear that this is related to debugging.

I'd be fine with this, or `transparent_debug_stepping`, etc. Just something other than `transparent` or `trampoline` as those are rather generic terms.

In D146595#4228425 <https://reviews.llvm.org/D146595#4228425>, @arphaman wrote:

> How is this attribute going to handle a trampoline that performs a virtual dispatch from C++ call into Swift? In that case, the target is not known.

Additionally, should you be allowed to write this on a lambda to skip over the function call operator? (If so, you may need to move the attribute from the lambda declaration onto the function call operator.)



================
Comment at: clang/include/clang/Basic/Attr.td:775
+  let Spellings = [Clang<"transparent_stepping">];
+  let Subjects = SubjectList<[Function]>;
+  let Documentation = [TransparentSteppingDocs];
----------------
ObjC method decls as well?


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:71
 
+static bool getIsTransparentStepping(const Decl *D) {
+  if (!D)
----------------
How about something like this ("get is" just sounds weird to me)?


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6773-6777
+static void handleTransparentStepping(Sema &S, Decl *D,
+                                          const ParsedAttr &AL) {
+  D->addAttr(::new (S.Context)
+                 TransparentSteppingAttr(S.Context, AL));
+}
----------------
Can be removed entirely if we don't have any custom checking logic for it. Instead, do `let SimpleHandler = 1;` in the attribute definition in Attr.td.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:9090-9092
+  case ParsedAttr::AT_TransparentStepping:
+    handleTransparentStepping(S, D, AL);
+    break;
----------------
This can also be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146595



More information about the cfe-commits mailing list