This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG20c9ac292504: [Index] USRGeneration doesn't depend on unnamed.printName() => ''. NFC (authored by sammccall).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135191/new/ https://reviews.llvm.org/D135191 Files: clang/lib/Index/USRGeneration.cpp Index: clang/lib/Index/USRGeneration.cpp =================================================================== --- clang/lib/Index/USRGeneration.cpp +++ clang/lib/Index/USRGeneration.cpp @@ -179,10 +179,11 @@ //===----------------------------------------------------------------------===// 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) {
Index: clang/lib/Index/USRGeneration.cpp =================================================================== --- clang/lib/Index/USRGeneration.cpp +++ clang/lib/Index/USRGeneration.cpp @@ -179,10 +179,11 @@ //===----------------------------------------------------------------------===// 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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits