[clang-tools-extra] 3b9715c - [NFC] Fix typos in Clangd and Clang

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 01:55:04 PST 2019


Author: Kirill Bobyrev
Date: 2019-12-16T10:54:40+01:00
New Revision: 3b9715cb219352fb831af144fd68e14e8fd275b4

URL: https://github.com/llvm/llvm-project/commit/3b9715cb219352fb831af144fd68e14e8fd275b4
DIFF: https://github.com/llvm/llvm-project/commit/3b9715cb219352fb831af144fd68e14e8fd275b4.diff

LOG: [NFC] Fix typos in Clangd and Clang

Reviewed by: Jim

Differential Revision: https://reviews.llvm.org/D71455

Added: 
    

Modified: 
    clang-tools-extra/clangd/AST.cpp
    clang-tools-extra/clangd/ClangdServer.cpp
    clang-tools-extra/clangd/CodeComplete.cpp
    clang-tools-extra/clangd/Diagnostics.cpp
    clang-tools-extra/clangd/Diagnostics.h
    clang-tools-extra/clangd/FindTarget.cpp
    clang-tools-extra/clangd/FormattedString.cpp
    clang-tools-extra/clangd/TUScheduler.cpp
    clang-tools-extra/clangd/Transport.h
    clang-tools-extra/clangd/XRefs.cpp
    clang-tools-extra/clangd/index/FileIndex.h
    clang-tools-extra/clangd/index/SymbolCollector.cpp
    clang-tools-extra/clangd/index/SymbolCollector.h
    clang-tools-extra/clangd/refactor/Rename.cpp
    clang/include/clang/Index/IndexDataConsumer.h
    clang/lib/Index/IndexingAction.cpp
    clang/lib/Index/IndexingContext.cpp
    clang/tools/c-index-test/core_main.cpp
    clang/tools/libclang/CXIndexDataConsumer.cpp
    clang/tools/libclang/CXIndexDataConsumer.h
    clang/unittests/Index/IndexTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp
index 65fdecc9e1ae..6aa02a7454dc 100644
--- a/clang-tools-extra/clangd/AST.cpp
+++ b/clang-tools-extra/clangd/AST.cpp
@@ -377,7 +377,7 @@ class DeducedTypeVisitor : public RecursiveASTVisitor<DeducedTypeVisitor> {
     // Loc of "auto" in operator auto()
     if (CurLoc.isInvalid() && dyn_cast<CXXConversionDecl>(D))
       CurLoc = D->getTypeSourceInfo()->getTypeLoc().getBeginLoc();
-    // Loc of "auto" in function with traling return type (c++11).
+    // Loc of "auto" in function with trailing return type (c++11).
     if (CurLoc.isInvalid())
       CurLoc = D->getSourceRange().getBegin();
     if (CurLoc != SearchedLocation)

diff  --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index a858680d4067..c71a8a0d566b 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -466,7 +466,7 @@ void ClangdServer::locateSymbolAt(PathRef File, Position Pos,
 
 void ClangdServer::switchSourceHeader(
     PathRef Path, Callback<llvm::Optional<clangd::Path>> CB) {
-  // We want to return the result as fast as possible, stragety is:
+  // We want to return the result as fast as possible, strategy is:
   //  1) use the file-only heuristic, it requires some IO but it is much
   //     faster than building AST, but it only works when .h/.cc files are in
   //     the same directory.

diff  --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp
index 4ef9842a381c..4e54b1a43e55 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -395,7 +395,7 @@ struct CodeCompletionBuilder {
     std::string ReturnType;
   };
 
-  // If all BundledEntrys have the same value for a property, return it.
+  // If all BundledEntries have the same value for a property, return it.
   template <std::string BundledEntry::*Member>
   const std::string *onlyValue() const {
     auto B = Bundled.begin(), E = Bundled.end();
@@ -499,7 +499,7 @@ llvm::Optional<SymbolID> getSymbolID(const CodeCompletionResult &R,
   llvm_unreachable("unknown CodeCompletionResult kind");
 }
 
-// Scopes of the paritial identifier we're trying to complete.
+// Scopes of the partial identifier we're trying to complete.
 // It is used when we query the index for more completion results.
 struct SpecifiedScope {
   // The scopes we should look in, determined by Sema.
@@ -874,7 +874,7 @@ class SignatureHelpCollector final : public CodeCompleteConsumer {
       // Function Template.
       // - High score is better.
       // - Shorter signature is better.
-      // - Alphebatically smaller is better.
+      // - Alphabetically smaller is better.
       if (L.Quality.NumberOfParameters != R.Quality.NumberOfParameters)
         return L.Quality.NumberOfParameters < R.Quality.NumberOfParameters;
       if (L.Quality.NumberOfOptionalParameters !=
@@ -1510,7 +1510,7 @@ class CodeCompleteFlow {
   }
 
   // Merges Sema and Index results where possible, to form CompletionCandidates.
-  // \p Identifiers is raw idenfiers that can also be completion condidates.
+  // \p Identifiers is raw idenfiers that can also be completion candidates.
   // Identifiers are not merged with results from index or sema.
   // Groups overloads if desired, to form CompletionCandidate::Bundles. The
   // bundles are scored and top results are returned, best to worst.

diff  --git a/clang-tools-extra/clangd/Diagnostics.cpp b/clang-tools-extra/clangd/Diagnostics.cpp
index 0670de087e2f..e78df0322eb3 100644
--- a/clang-tools-extra/clangd/Diagnostics.cpp
+++ b/clang-tools-extra/clangd/Diagnostics.cpp
@@ -232,7 +232,7 @@ std::string capitalize(std::string Message) {
 }
 
 /// Returns a message sent to LSP for the main diagnostic in \p D.
-/// This message may include notes, if they're not emited in some other way.
+/// This message may include notes, if they're not emitted in some other way.
 /// Example output:
 ///
 ///     no matching function for call to 'foo'

diff  --git a/clang-tools-extra/clangd/Diagnostics.h b/clang-tools-extra/clangd/Diagnostics.h
index 6d848ce2a3c0..7461f8529c2f 100644
--- a/clang-tools-extra/clangd/Diagnostics.h
+++ b/clang-tools-extra/clangd/Diagnostics.h
@@ -53,7 +53,7 @@ struct ClangdDiagnosticOptions {
 struct DiagBase {
   std::string Message;
   // Intended to be used only in error messages.
-  // May be relative, absolute or even artifically constructed.
+  // May be relative, absolute or even artificially constructed.
   std::string File;
   // Absolute path to containing file, if available.
   llvm::Optional<std::string> AbsFile;

diff  --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp
index a4c17dbefded..81d4e93ed3c2 100644
--- a/clang-tools-extra/clangd/FindTarget.cpp
+++ b/clang-tools-extra/clangd/FindTarget.cpp
@@ -649,10 +649,10 @@ llvm::SmallVector<ReferenceLoc, 2> refInTypeLoc(TypeLoc L) {
   return {*V.Ref};
 }
 
-class ExplicitReferenceColletor
-    : public RecursiveASTVisitor<ExplicitReferenceColletor> {
+class ExplicitReferenceCollector
+    : public RecursiveASTVisitor<ExplicitReferenceCollector> {
 public:
-  ExplicitReferenceColletor(llvm::function_ref<void(ReferenceLoc)> Out)
+  ExplicitReferenceCollector(llvm::function_ref<void(ReferenceLoc)> Out)
       : Out(Out) {
     assert(Out);
   }
@@ -798,16 +798,16 @@ class ExplicitReferenceColletor
 void findExplicitReferences(const Stmt *S,
                             llvm::function_ref<void(ReferenceLoc)> Out) {
   assert(S);
-  ExplicitReferenceColletor(Out).TraverseStmt(const_cast<Stmt *>(S));
+  ExplicitReferenceCollector(Out).TraverseStmt(const_cast<Stmt *>(S));
 }
 void findExplicitReferences(const Decl *D,
                             llvm::function_ref<void(ReferenceLoc)> Out) {
   assert(D);
-  ExplicitReferenceColletor(Out).TraverseDecl(const_cast<Decl *>(D));
+  ExplicitReferenceCollector(Out).TraverseDecl(const_cast<Decl *>(D));
 }
 void findExplicitReferences(const ASTContext &AST,
                             llvm::function_ref<void(ReferenceLoc)> Out) {
-  ExplicitReferenceColletor(Out).TraverseAST(const_cast<ASTContext &>(AST));
+  ExplicitReferenceCollector(Out).TraverseAST(const_cast<ASTContext &>(AST));
 }
 
 llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, DeclRelation R) {

diff  --git a/clang-tools-extra/clangd/FormattedString.cpp b/clang-tools-extra/clangd/FormattedString.cpp
index 69d33a45ada1..5c225139de23 100644
--- a/clang-tools-extra/clangd/FormattedString.cpp
+++ b/clang-tools-extra/clangd/FormattedString.cpp
@@ -28,7 +28,7 @@ namespace {
 /// Escape a markdown text block. Ensures the punctuation will not introduce
 /// any of the markdown constructs.
 std::string renderText(llvm::StringRef Input) {
-  // Escaping ASCII punctiation ensures we can't start a markdown construct.
+  // Escaping ASCII punctuation ensures we can't start a markdown construct.
   constexpr llvm::StringLiteral Punctuation =
       R"txt(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)txt";
 
@@ -93,7 +93,7 @@ std::string getMarkerForCodeBlock(llvm::StringRef Input) {
   return std::string(/*Repeat=*/std::max(3u, MaxBackticks + 1), '`');
 }
 
-// Trims the input and concatanates whitespace blocks into a single ` `.
+// Trims the input and concatenates whitespace blocks into a single ` `.
 std::string canonicalizeSpaces(std::string Input) {
   // Goes over the string and preserves only a single ` ` for any whitespace
   // chunks, the rest is moved to the end of the string and dropped in the end.
@@ -102,7 +102,7 @@ std::string canonicalizeSpaces(std::string Input) {
   llvm::SplitString(Input, Words);
   if (Words.empty())
     return "";
-  // Go over each word and and add it to the string.
+  // Go over each word and add it to the string.
   for (llvm::StringRef Word : Words) {
     llvm::for_each(Word, [&WritePtr](const char C) { *WritePtr++ = C; });
     // Separate from next block.

diff  --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index 884c82d5b190..c4f9e6e69553 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -480,7 +480,7 @@ void ASTWorker::update(ParseInputs Inputs, WantDiagnostics WantDiags) {
 
     {
       std::lock_guard<std::mutex> Lock(PublishMu);
-      // No need to rebuild the AST if we won't send the diagnotics. However,
+      // No need to rebuild the AST if we won't send the diagnostics. However,
       // note that we don't prevent preamble rebuilds.
       if (!CanPublishResults)
         return;

diff  --git a/clang-tools-extra/clangd/Transport.h b/clang-tools-extra/clangd/Transport.h
index 1cca573c6853..ae6da722d91b 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -55,7 +55,7 @@ class Transport {
   };
   // Called by Clangd to receive messages from the client.
   // The transport should in turn invoke the handler to process messages.
-  // If handler returns false, the transport should immedately exit the loop.
+  // If handler returns false, the transport should immediately exit the loop.
   // (This is used to implement the `exit` notification).
   // Otherwise, it returns an error when the transport becomes unusable.
   virtual llvm::Error loop(MessageHandler &) = 0;

diff  --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index d9a54ad971c4..1ca388f49f86 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -120,7 +120,7 @@ SymbolLocation getPreferredLocation(const Location &ASTLoc,
                                     const SymbolLocation &IdxLoc,
                                     std::string &Scratch) {
   // Also use a dummy symbol for the index location so that other fields (e.g.
-  // definition) are not factored into the preferrence.
+  // definition) are not factored into the preference.
   Symbol ASTSym, IdxSym;
   ASTSym.ID = IdxSym.ID = SymbolID("dummy_id");
   ASTSym.CanonicalDeclaration = toIndexLocation(ASTLoc, Scratch);
@@ -353,10 +353,10 @@ class ReferenceFinder : public index::IndexDataConsumer {
   }
 
   bool
-  handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles,
-                      llvm::ArrayRef<index::SymbolRelation> Relations,
-                      SourceLocation Loc,
-                      index::IndexDataConsumer::ASTNodeInfo ASTNode) override {
+  handleDeclOccurrence(const Decl *D, index::SymbolRoleSet Roles,
+                       llvm::ArrayRef<index::SymbolRelation> Relations,
+                       SourceLocation Loc,
+                       index::IndexDataConsumer::ASTNodeInfo ASTNode) override {
     assert(D->isCanonicalDecl() && "expect D to be a canonical declaration");
     const SourceManager &SM = AST.getSourceManager();
     Loc = SM.getFileLoc(Loc);

diff  --git a/clang-tools-extra/clangd/index/FileIndex.h b/clang-tools-extra/clangd/index/FileIndex.h
index a60364fc0021..411130c59547 100644
--- a/clang-tools-extra/clangd/index/FileIndex.h
+++ b/clang-tools-extra/clangd/index/FileIndex.h
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 //
 // FileIndex implements SymbolIndex for symbols from a set of files. Symbols are
-// maintained at source-file granuality (e.g. with ASTs), and files can be
+// maintained at source-file granularity (e.g. with ASTs), and files can be
 // updated dynamically.
 //
 //===----------------------------------------------------------------------===//

diff  --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp b/clang-tools-extra/clangd/index/SymbolCollector.cpp
index ac782c07c7aa..c0b2b52a43ce 100644
--- a/clang-tools-extra/clangd/index/SymbolCollector.cpp
+++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp
@@ -245,14 +245,14 @@ bool SymbolCollector::shouldCollectSymbol(const NamedDecl &ND,
 }
 
 // Always return true to continue indexing.
-bool SymbolCollector::handleDeclOccurence(
+bool SymbolCollector::handleDeclOccurrence(
     const Decl *D, index::SymbolRoleSet Roles,
     llvm::ArrayRef<index::SymbolRelation> Relations, SourceLocation Loc,
     index::IndexDataConsumer::ASTNodeInfo ASTNode) {
   assert(ASTCtx && PP.get() && "ASTContext and Preprocessor must be set.");
   assert(CompletionAllocator && CompletionTUInfo);
   assert(ASTNode.OrigD);
-  // Indexing API puts cannonical decl into D, which might not have a valid
+  // Indexing API puts canonical decl into D, which might not have a valid
   // source location for implicit/built-in decls. Fallback to original decl in
   // such cases.
   if (D->getLocation().isInvalid())
@@ -346,10 +346,10 @@ bool SymbolCollector::handleDeclOccurence(
   return true;
 }
 
-bool SymbolCollector::handleMacroOccurence(const IdentifierInfo *Name,
-                                           const MacroInfo *MI,
-                                           index::SymbolRoleSet Roles,
-                                           SourceLocation Loc) {
+bool SymbolCollector::handleMacroOccurrence(const IdentifierInfo *Name,
+                                            const MacroInfo *MI,
+                                            index::SymbolRoleSet Roles,
+                                            SourceLocation Loc) {
   assert(PP.get());
 
   const auto &SM = PP->getSourceManager();
@@ -524,9 +524,8 @@ void SymbolCollector::finish() {
         auto FileURI = toURI(SM, FileEntry->getName(), Opts);
         Found = URICache.insert({FID, FileURI}).first;
       } else {
-        // Ignore cases where we can not find a corresponding file entry
-        // for the loc, thoses are not interesting, e.g. symbols formed
-        // via macro concatenation.
+        // Ignore cases where we can not find a corresponding file entry for
+        // given location, e.g. symbols formed via macro concatenation.
         return None;
       }
     }

diff  --git a/clang-tools-extra/clangd/index/SymbolCollector.h b/clang-tools-extra/clangd/index/SymbolCollector.h
index bc5095d516db..7643b1f82868 100644
--- a/clang-tools-extra/clangd/index/SymbolCollector.h
+++ b/clang-tools-extra/clangd/index/SymbolCollector.h
@@ -99,14 +99,14 @@ class SymbolCollector : public index::IndexDataConsumer {
   }
 
   bool
-  handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles,
-                      ArrayRef<index::SymbolRelation> Relations,
-                      SourceLocation Loc,
-                      index::IndexDataConsumer::ASTNodeInfo ASTNode) override;
-
-  bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI,
-                            index::SymbolRoleSet Roles,
-                            SourceLocation Loc) override;
+  handleDeclOccurrence(const Decl *D, index::SymbolRoleSet Roles,
+                       ArrayRef<index::SymbolRelation> Relations,
+                       SourceLocation Loc,
+                       index::IndexDataConsumer::ASTNodeInfo ASTNode) override;
+
+  bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI,
+                             index::SymbolRoleSet Roles,
+                             SourceLocation Loc) override;
 
   SymbolSlab takeSymbols() { return std::move(Symbols).build(); }
   RefSlab takeRefs() { return std::move(Refs).build(); }

diff  --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp
index 010f7e388b55..7d97ac8c9645 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -364,7 +364,7 @@ llvm::Expected<FileEdits> renameOutsideFile(
                            std::move(FileAndOccurrences.second),
                            RenameDecl.getASTContext().getLangOpts());
     if (!RenameRanges) {
-      // Our heuristice fails to adjust rename ranges to the current state of
+      // Our heuristics fails to adjust rename ranges to the current state of
       // the file, it is most likely the index is stale, so we give up the
       // entire rename.
       return llvm::make_error<llvm::StringError>(
@@ -387,7 +387,7 @@ llvm::Expected<FileEdits> renameOutsideFile(
   return Results;
 }
 
-// A simple edit is eithor changing line or column, but not both.
+// A simple edit is either changing line or column, but not both.
 bool impliesSimpleEdit(const Position &LHS, const Position &RHS) {
   return LHS.line == RHS.line || LHS.character == RHS.character;
 }

diff  --git a/clang/include/clang/Index/IndexDataConsumer.h b/clang/include/clang/Index/IndexDataConsumer.h
index 72747821bf54..e732659e4847 100644
--- a/clang/include/clang/Index/IndexDataConsumer.h
+++ b/clang/include/clang/Index/IndexDataConsumer.h
@@ -39,16 +39,16 @@ class IndexDataConsumer {
   virtual void setPreprocessor(std::shared_ptr<Preprocessor> PP) {}
 
   /// \returns true to continue indexing, or false to abort.
-  virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
-                                   ArrayRef<SymbolRelation> Relations,
-                                   SourceLocation Loc, ASTNodeInfo ASTNode) {
+  virtual bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles,
+                                    ArrayRef<SymbolRelation> Relations,
+                                    SourceLocation Loc, ASTNodeInfo ASTNode) {
     return true;
   }
 
   /// \returns true to continue indexing, or false to abort.
-  virtual bool handleMacroOccurence(const IdentifierInfo *Name,
-                                    const MacroInfo *MI, SymbolRoleSet Roles,
-                                    SourceLocation Loc) {
+  virtual bool handleMacroOccurrence(const IdentifierInfo *Name,
+                                     const MacroInfo *MI, SymbolRoleSet Roles,
+                                     SourceLocation Loc) {
     return true;
   }
 
@@ -57,9 +57,9 @@ class IndexDataConsumer {
   /// This will be called for each module reference in an import decl.
   /// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the
   /// 'reference' role, and a call for 'SubMod' with the 'declaration' role.
-  virtual bool handleModuleOccurence(const ImportDecl *ImportD,
-                                     const Module *Mod, SymbolRoleSet Roles,
-                                     SourceLocation Loc) {
+  virtual bool handleModuleOccurrence(const ImportDecl *ImportD,
+                                      const Module *Mod, SymbolRoleSet Roles,
+                                      SourceLocation Loc) {
     return true;
   }
 

diff  --git a/clang/lib/Index/IndexingAction.cpp b/clang/lib/Index/IndexingAction.cpp
index 6d6133e89d86..4f402135672c 100644
--- a/clang/lib/Index/IndexingAction.cpp
+++ b/clang/lib/Index/IndexingAction.cpp
@@ -151,7 +151,7 @@ static void indexPreprocessorMacros(const Preprocessor &PP,
                                     IndexDataConsumer &DataConsumer) {
   for (const auto &M : PP.macros())
     if (MacroDirective *MD = M.second.getLatest())
-      DataConsumer.handleMacroOccurence(
+      DataConsumer.handleMacroOccurrence(
           M.first, MD->getMacroInfo(),
           static_cast<unsigned>(index::SymbolRole::Definition),
           MD->getLocation());

diff  --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp
index c7e487ab9ae6..a7c37e8528d1 100644
--- a/clang/lib/Index/IndexingContext.cpp
+++ b/clang/lib/Index/IndexingContext.cpp
@@ -99,9 +99,8 @@ static void reportModuleReferences(const Module *Mod,
     return;
   reportModuleReferences(Mod->Parent, IdLocs.drop_back(), ImportD,
                          DataConsumer);
-  DataConsumer.handleModuleOccurence(ImportD, Mod,
-                                     (SymbolRoleSet)SymbolRole::Reference,
-                                     IdLocs.back());
+  DataConsumer.handleModuleOccurrence(
+      ImportD, Mod, (SymbolRoleSet)SymbolRole::Reference, IdLocs.back());
 }
 
 bool IndexingContext::importedModule(const ImportDecl *ImportD) {
@@ -145,7 +144,7 @@ bool IndexingContext::importedModule(const ImportDecl *ImportD) {
   if (ImportD->isImplicit())
     Roles |= (unsigned)SymbolRole::Implicit;
 
-  return DataConsumer.handleModuleOccurence(ImportD, Mod, Roles, Loc);
+  return DataConsumer.handleModuleOccurrence(ImportD, Mod, Roles, Loc);
 }
 
 bool IndexingContext::isTemplateImplicitInstantiation(const Decl *D) {
@@ -443,26 +442,26 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
   }
 
   IndexDataConsumer::ASTNodeInfo Node{OrigE, OrigD, Parent, ContainerDC};
-  return DataConsumer.handleDeclOccurence(D, Roles, FinalRelations, Loc, Node);
+  return DataConsumer.handleDeclOccurrence(D, Roles, FinalRelations, Loc, Node);
 }
 
 void IndexingContext::handleMacroDefined(const IdentifierInfo &Name,
                                          SourceLocation Loc,
                                          const MacroInfo &MI) {
   SymbolRoleSet Roles = (unsigned)SymbolRole::Definition;
-  DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc);
+  DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc);
 }
 
 void IndexingContext::handleMacroUndefined(const IdentifierInfo &Name,
                                            SourceLocation Loc,
                                            const MacroInfo &MI) {
   SymbolRoleSet Roles = (unsigned)SymbolRole::Undefinition;
-  DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc);
+  DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc);
 }
 
 void IndexingContext::handleMacroReference(const IdentifierInfo &Name,
                                            SourceLocation Loc,
                                            const MacroInfo &MI) {
   SymbolRoleSet Roles = (unsigned)SymbolRole::Reference;
-  DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc);
+  DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc);
 }

diff  --git a/clang/tools/c-index-test/core_main.cpp b/clang/tools/c-index-test/core_main.cpp
index faf8b668b4e3..c40250801248 100644
--- a/clang/tools/c-index-test/core_main.cpp
+++ b/clang/tools/c-index-test/core_main.cpp
@@ -94,9 +94,9 @@ class PrintIndexDataConsumer : public IndexDataConsumer {
     this->PP = std::move(PP);
   }
 
-  bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
-                           ArrayRef<SymbolRelation> Relations,
-                           SourceLocation Loc, ASTNodeInfo ASTNode) override {
+  bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles,
+                            ArrayRef<SymbolRelation> Relations,
+                            SourceLocation Loc, ASTNodeInfo ASTNode) override {
     ASTContext &Ctx = D->getASTContext();
     SourceManager &SM = Ctx.getSourceManager();
 
@@ -132,9 +132,9 @@ class PrintIndexDataConsumer : public IndexDataConsumer {
     return true;
   }
 
-  bool handleModuleOccurence(const ImportDecl *ImportD,
-                             const clang::Module *Mod,
-                             SymbolRoleSet Roles, SourceLocation Loc) override {
+  bool handleModuleOccurrence(const ImportDecl *ImportD,
+                              const clang::Module *Mod, SymbolRoleSet Roles,
+                              SourceLocation Loc) override {
     ASTContext &Ctx = ImportD->getASTContext();
     SourceManager &SM = Ctx.getSourceManager();
 
@@ -156,8 +156,8 @@ class PrintIndexDataConsumer : public IndexDataConsumer {
     return true;
   }
 
-  bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI,
-                            SymbolRoleSet Roles, SourceLocation Loc) override {
+  bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI,
+                             SymbolRoleSet Roles, SourceLocation Loc) override {
     assert(PP);
     SourceManager &SM = PP->getSourceManager();
 

diff  --git a/clang/tools/libclang/CXIndexDataConsumer.cpp b/clang/tools/libclang/CXIndexDataConsumer.cpp
index 2cd7e0c8d22b..ad871228ccdf 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.cpp
+++ b/clang/tools/libclang/CXIndexDataConsumer.cpp
@@ -154,7 +154,7 @@ CXSymbolRole getSymbolRole(SymbolRoleSet Role) {
 }
 }
 
-bool CXIndexDataConsumer::handleDeclOccurence(
+bool CXIndexDataConsumer::handleDeclOccurrence(
     const Decl *D, SymbolRoleSet Roles, ArrayRef<SymbolRelation> Relations,
     SourceLocation Loc, ASTNodeInfo ASTNode) {
   Loc = getASTContext().getSourceManager().getFileLoc(Loc);
@@ -220,10 +220,10 @@ bool CXIndexDataConsumer::handleDeclOccurence(
   return !shouldAbort();
 }
 
-bool CXIndexDataConsumer::handleModuleOccurence(const ImportDecl *ImportD,
-                                                const Module *Mod,
-                                                SymbolRoleSet Roles,
-                                                SourceLocation Loc) {
+bool CXIndexDataConsumer::handleModuleOccurrence(const ImportDecl *ImportD,
+                                                 const Module *Mod,
+                                                 SymbolRoleSet Roles,
+                                                 SourceLocation Loc) {
   if (Roles & (SymbolRoleSet)SymbolRole::Declaration)
     IndexingDeclVisitor(*this, SourceLocation(), nullptr).Visit(ImportD);
   return !shouldAbort();

diff  --git a/clang/tools/libclang/CXIndexDataConsumer.h b/clang/tools/libclang/CXIndexDataConsumer.h
index 42165c4e3460..ace9d59bf045 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.h
+++ b/clang/tools/libclang/CXIndexDataConsumer.h
@@ -431,13 +431,13 @@ class CXIndexDataConsumer : public index::IndexDataConsumer {
   static bool isTemplateImplicitInstantiation(const Decl *D);
 
 private:
-  bool handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles,
-                           ArrayRef<index::SymbolRelation> Relations,
-                           SourceLocation Loc, ASTNodeInfo ASTNode) override;
+  bool handleDeclOccurrence(const Decl *D, index::SymbolRoleSet Roles,
+                            ArrayRef<index::SymbolRelation> Relations,
+                            SourceLocation Loc, ASTNodeInfo ASTNode) override;
 
-  bool handleModuleOccurence(const ImportDecl *ImportD, const Module *Mod,
-                             index::SymbolRoleSet Roles,
-                             SourceLocation Loc) override;
+  bool handleModuleOccurrence(const ImportDecl *ImportD, const Module *Mod,
+                              index::SymbolRoleSet Roles,
+                              SourceLocation Loc) override;
 
   void finish() override;
 

diff  --git a/clang/unittests/Index/IndexTests.cpp b/clang/unittests/Index/IndexTests.cpp
index 752dab857ec3..000cfe212505 100644
--- a/clang/unittests/Index/IndexTests.cpp
+++ b/clang/unittests/Index/IndexTests.cpp
@@ -74,9 +74,9 @@ class Indexer : public IndexDataConsumer {
     IndexDataConsumer::initialize(Ctx);
   }
 
-  bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
-                           ArrayRef<SymbolRelation>, SourceLocation Loc,
-                           ASTNodeInfo) override {
+  bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles,
+                            ArrayRef<SymbolRelation>, SourceLocation Loc,
+                            ASTNodeInfo) override {
     const auto *ND = llvm::dyn_cast<NamedDecl>(D);
     if (!ND)
       return true;
@@ -91,8 +91,8 @@ class Indexer : public IndexDataConsumer {
     return true;
   }
 
-  bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI,
-                            SymbolRoleSet Roles, SourceLocation Loc) override {
+  bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI,
+                             SymbolRoleSet Roles, SourceLocation Loc) override {
     TestSymbol S;
     S.SymInfo = getSymbolInfoForMacro(*MI);
     S.QName = Name->getName();


        


More information about the cfe-commits mailing list