paulkirth added subscribers: nickdesaulniers, phosek.
paulkirth added a comment.

@nickdesaulniers @phosek You may be interested in this super hacky prototype. 
There's a bunch of things to improve(tests, output, code structure, 
plumbing...), but when we emit the diagnostic for `-Wframe-larger-than` we have 
enough information to print all stack slots, their size, and position relative 
to SP. If we have debug info, we can print all the variables, and which slots 
they map to. It doesn't give you live ranges, but they shouldn't map to 
multiple slots anyway. For spill slots, I don't think it's worth doing much 
other than to show they exist. Roland mentioned there's probably a clever way 
to do this using only DWARF, but that it's probably simpler to do in the 
compiler backend.

I'm probably going to be tied up w/ other work for a bit, so I don't expect to 
finish the prototype very soon, but it's at least POC.

`clang -Wframe-larger-than=0 frame-diags.c -c -o /dev/null -g -O2` is the 
command I've been using locally. Whenever that warning fires, we print the 
stack layout.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135488

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to