[AnnotationRemarks] Use subprogram location for summary remarks.
authorFlorian Hahn <flo@fhahn.com>
Tue, 23 Mar 2021 11:59:08 +0000 (11:59 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 23 Mar 2021 12:05:41 +0000 (12:05 +0000)
commite43e8e913821f8db3684c384f5760b8e6e12e0d8
treef4c5e0591beee0382f94ef5009f6db333d2fbbe6
parent8f80c66bd2982788a8eede4419684ca72f48b9a2
[AnnotationRemarks] Use subprogram location for summary remarks.

The summary remarks are generated on a per-function basis. Using the
first instruction's location is sub-optimal for 2 reasons:
  1. Sometimes the first instruction is missing !dbg
  2. The location of the first instruction may be mis-leading.

Instead, just use the location of the function directly.
llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll