[PATCH] D89787: [AsmParser] Add source location to all errors related to .cfi directives

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 16:05:18 PDT 2020


MaskRay added a comment.

In D89787#2365826 <https://reviews.llvm.org/D89787#2365826>, @rnk wrote:

> In D89787#2365823 <https://reviews.llvm.org/D89787#2365823>, @MaskRay wrote:
>
>> In D89787#2365791 <https://reviews.llvm.org/D89787#2365791>, @rnk wrote:
>>
>>> I've been thinking about this problem of missing SMLocs for a while, and I think the right direction is probably for MCStreamer to have a way to get the location of the beginning of the directive being processed. That would suffice for the majority of these `.cfi_*` directives. It would make it much easier to get error reporting right by default or to add in error reporting later.
>>
>> How should MCStreamer get an access to the parser's SMLoc? The constructor of AsmParser has a non-const reference to MCStreamer. Add a SMLoc pointer in MCStreamer and make it aware of the parser's SMLoc in the constructor of AsmParser?
>
> Sounds reasonable to me. Note, it's not the current parser location, it's the saved location of the start of the directive, but otherwise, that's the idea.

OK, D90511 <https://reviews.llvm.org/D90511> for the idea.

(I confess I committed a symbol binding related SMLoc change abruptly yesterday.. Sorry)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89787



More information about the llvm-commits mailing list