[clang-tools-extra] 1e82121 - [clangd] Add more trace spans for rename, NFC.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 10:57:17 PST 2020


Author: Haojian Wu
Date: 2020-11-24T19:57:05+01:00
New Revision: 1e821217cb3619449d536978bae7c9f05bdf0fa5

URL: https://github.com/llvm/llvm-project/commit/1e821217cb3619449d536978bae7c9f05bdf0fa5
DIFF: https://github.com/llvm/llvm-project/commit/1e821217cb3619449d536978bae7c9f05bdf0fa5.diff

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

Added: 
    

Modified: 
    clang-tools-extra/clangd/refactor/Rename.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp
index d10a7a4574ba..e7924b4add09 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -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()};


        


More information about the cfe-commits mailing list