[PATCH] D97405: [Remarks] Emit remarks for "auto-init" !annotations

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 11:40:11 PST 2021


thegameg created this revision.
thegameg added reviewers: fhahn, paquette, jdoerfert.
Herald added subscribers: jfb, hiraditya.
thegameg requested review of this revision.
Herald added a project: LLVM.

Using the `!annotation` metadata, emit remarks pointing to code added by `-ftrivial-auto-var-init` that survived the optimizer.

Example:

  auto-init.c:4:7: remark: Initialization inserted by -ftrivial-auto-var-init. [-Rpass-missed=annotation-remarks]
    int buf[1024];
        ^

The tests are testing various situations like calls/stores/other instructions, with debug locations, and extra debug information on purpose: more patches will come to improve the reporting to make it more user-friendly, and these tests will show how the reporting evolves.


https://reviews.llvm.org/D97405

Files:
  llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
  llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
  llvm/test/Transforms/Util/trivial-auto-var-init-store.ll
  llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97405.326158.patch
Type: text/x-patch
Size: 31689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210224/fc16d3ea/attachment.bin>


More information about the llvm-commits mailing list