[NFC] Fix typos in Clangd and Clang

Reviewed by: Jim

Differential Revision: https://reviews.llvm.org/D71455
diff --git a/clang/include/clang/Index/IndexDataConsumer.h b/clang/include/clang/Index/IndexDataConsumer.h
index 7274782..e732659 100644
--- a/clang/include/clang/Index/IndexDataConsumer.h
+++ b/clang/include/clang/Index/IndexDataConsumer.h
@@ -39,16 +39,16 @@
   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 @@
   /// 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 6d6133e..4f40213 100644
--- a/clang/lib/Index/IndexingAction.cpp
+++ b/clang/lib/Index/IndexingAction.cpp
@@ -151,7 +151,7 @@
                                     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 c7e487a..a7c37e8 100644
--- a/clang/lib/Index/IndexingContext.cpp
+++ b/clang/lib/Index/IndexingContext.cpp
@@ -99,9 +99,8 @@
     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 @@
   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 @@
   }
 
   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 faf8b66..c402508 100644
--- a/clang/tools/c-index-test/core_main.cpp
+++ b/clang/tools/c-index-test/core_main.cpp
@@ -94,9 +94,9 @@
     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 @@
     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 @@
     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 2cd7e0c..ad87122 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.cpp
+++ b/clang/tools/libclang/CXIndexDataConsumer.cpp
@@ -154,7 +154,7 @@
 }
 }
 
-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 @@
   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 42165c4..ace9d59 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.h
+++ b/clang/tools/libclang/CXIndexDataConsumer.h
@@ -431,13 +431,13 @@
   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 752dab8..000cfe2 100644
--- a/clang/unittests/Index/IndexTests.cpp
+++ b/clang/unittests/Index/IndexTests.cpp
@@ -74,9 +74,9 @@
     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 @@
     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();