[PATCH] D148975: -fdebug-prefix-map=: make the last win when multiple prefixes match

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 25 14:41:48 PDT 2023


MaskRay added a comment.

In D148975#4296625 <https://reviews.llvm.org/D148975#4296625>, @scott.linder wrote:

> LGTM, thank you!
>
> Does this warrant a release note, as it is changing the behavior in a backwards-incompatible manner? I do think changing to match GCC is worthwhile, even if it means a change in behavior for Clang.
>
> I also don't think the "longest first" heuristic is useful enough to outweigh the benefits of behaving like GCC; it seems like the user can always sort their own options to get the same effect.

Thank you! I feel that specifying multiple `-fdebug-prefix-map=` is a very uncommon situation, so a release note entry is likely overkill.
I updated the HelpText, though.

In D148975#4289159 <https://reviews.llvm.org/D148975#4289159>, @joerg wrote:

> For me long matching prefix makes more sense, but if the same prefix is used multiple times, the last option should win.

"if the same prefix is used multiple times, the last option should win." I think this interpretation will add some complexity, e.g. whether we prefer `-fdebug-prefix-map=a/=b` or `-fdebug-prefix-map=a=c`. GCC's current rule (simple) seems quite reasonable.

>From the discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109591 , GCC will likely remain the current behavior and will improve the documentation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148975



More information about the cfe-commits mailing list