[PATCH] D143803: [clang][alias|ifunc]: Add a diagnostic for mangled names

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 24 08:38:56 PST 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:359-360
+        if (ND->getName() == GV->getName()) {
+           Diags.Report(Location, diag::note_alias_requires_mangled_name)
+               << GV->getName() << Name;
+        }
----------------
erichkeane wrote:
> aaron.ballman wrote:
> > 0xdc03 wrote:
> > > aaron.ballman wrote:
> > > > Should this come with a fix-it to switch the attribute to using the mangled name instead?
> > > I did consider it, however I have no idea how to implement that 😅 
> > We have some documentation on that: https://clang.llvm.org/docs/InternalsManual.html#fix-it-hints
> > 
> > The basic idea here is that you'd create a replacement range so you can replace the old name with the new one.
> Do we have to do some work to make sure we dont suggest multiple fixits?  Or is that OK?
So long as each fix-it is associated with its own note, that's fine. We don't allow fix-its attached to notes to be automatically applied (specifically because we're either not certain the fix is correct or because there may be multiple fixes for the user to pick from).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143803



More information about the cfe-commits mailing list