We use the name from the IdentifierInfo of the Macro to compute its
SymbolID. It is better to just take the Name as a parameter to avoid
storing the IdentifierInfo whenever we need the SymbolID for the Macro.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Does that mean we identify each macro merely by its name?
It's not uncommon to have multiple #define for the same name, meaning completely different things.
If find references shows all of those, it's not very useful...
no, I would say this patch is NFC, we still construct macro symbol id with macro name and definition location.
We actually use both the name and the source location of the macro to calculate its ID.
I see that the subject of the patch might suggest otherwise.
This is a trivial change which just changes the params of the function so that users don't have to carry the IdentifierInfo when we just want the name out of it.
We use clang::index::generateUSRForMacro(StringRef MacroName, SourceLocation Loc, const SourceManager &SM, SmallVectorImpl<char> &Buf) to generate the SymbolID.
Sorry for not reading through and assuming the wrong thing from the title. Thanks for the explanation! LG
hmm, this is a unrelated change.