mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 10:26:44 +00:00
[clangd] Make sure macro information exists before increasing usage count.
llvm-svn: 336581
This commit is contained in:
parent
0566f2352a
commit
a62c9d62a3
@ -371,7 +371,6 @@ bool SymbolCollector::handleMacroOccurence(const IdentifierInfo *Name,
|
||||
Roles & static_cast<unsigned>(index::SymbolRole::Definition)))
|
||||
return true;
|
||||
|
||||
|
||||
llvm::SmallString<128> USR;
|
||||
if (index::generateUSRForMacro(Name->getName(), MI->getDefinitionLoc(), SM,
|
||||
USR))
|
||||
@ -433,11 +432,10 @@ void SymbolCollector::finish() {
|
||||
assert(PP);
|
||||
for (const IdentifierInfo *II : ReferencedMacros) {
|
||||
llvm::SmallString<128> USR;
|
||||
if (!index::generateUSRForMacro(
|
||||
II->getName(),
|
||||
PP->getMacroDefinition(II).getMacroInfo()->getDefinitionLoc(),
|
||||
PP->getSourceManager(), USR))
|
||||
IncRef(SymbolID(USR));
|
||||
if (const auto *MI = PP->getMacroDefinition(II).getMacroInfo())
|
||||
if (!index::generateUSRForMacro(II->getName(), MI->getDefinitionLoc(),
|
||||
PP->getSourceManager(), USR))
|
||||
IncRef(SymbolID(USR));
|
||||
}
|
||||
}
|
||||
ReferencedDecls.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user