Skip to content

Commit

Permalink
[Index] USRGeneration doesn't depend on unnamed.printName() => ''. NFC
Browse files Browse the repository at this point in the history
This prepares for printName() to print `(anonymous struct)` etc in D134813.

Differential Revision: https://reviews.llvm.org/D135191
  • Loading branch information
sam-mccall committed Oct 5, 2022
1 parent 0a50eaf commit 20c9ac2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clang/lib/Index/USRGeneration.cpp
Expand Up @@ -179,10 +179,11 @@ class USRGenerator : public ConstDeclVisitor<USRGenerator> {
//===----------------------------------------------------------------------===//

bool USRGenerator::EmitDeclName(const NamedDecl *D) {
const unsigned startSize = Buf.size();
D->printName(Out);
const unsigned endSize = Buf.size();
return startSize == endSize;
DeclarationName N = D->getDeclName();
if (N.isEmpty())
return true;
Out << N;
return false;
}

bool USRGenerator::ShouldGenerateLocation(const NamedDecl *D) {
Expand Down

0 comments on commit 20c9ac2

Please sign in to comment.