[clangd] Add more trace spans for rename, NFC.

This commit is contained in:
Haojian Wu 2020-11-24 19:44:42 +01:00
parent 678b9c5dde
commit 1e821217cb
1 changed files with 2 additions and 0 deletions

View File

@ -300,6 +300,7 @@ std::vector<SourceLocation> findOccurrencesWithinFile(ParsedAST &AST,
const NamedDecl *lookupSiblingWithName(const ASTContext &Ctx,
const NamedDecl &RenamedDecl,
llvm::StringRef Name) {
trace::Span Tracer("LookupSiblingWithName");
const auto &II = Ctx.Idents.get(Name);
DeclarationName LookupName(&II);
DeclContextLookupResult LookupResult;
@ -359,6 +360,7 @@ llvm::Error makeError(InvalidName Reason) {
// Return details if the rename would produce a conflict.
llvm::Optional<InvalidName> checkName(const NamedDecl &RenameDecl,
llvm::StringRef NewName) {
trace::Span Tracer("CheckName");
auto &ASTCtx = RenameDecl.getASTContext();
if (isKeyword(NewName, ASTCtx.getLangOpts()))
return InvalidName{InvalidName::Keywords, NewName.str()};