[clang] 4cd1098 - Improve const-correctness. NFC.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 23 16:54:44 PDT 2021


Author: Richard Smith
Date: 2021-03-23T16:54:27-07:00
New Revision: 4cd109891cbc448819eb9de9104cd14d993e45b1

URL: https://github.com/llvm/llvm-project/commit/4cd109891cbc448819eb9de9104cd14d993e45b1
DIFF: https://github.com/llvm/llvm-project/commit/4cd109891cbc448819eb9de9104cd14d993e45b1.diff

LOG: Improve const-correctness. NFC.

Added: 
    

Modified: 
    clang/include/clang/Lex/MacroInfo.h
    clang/include/clang/Lex/Preprocessor.h
    clang/lib/Lex/PPDirectives.cpp
    clang/lib/Lex/PPMacroExpansion.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Lex/MacroInfo.h b/clang/include/clang/Lex/MacroInfo.h
index 550abf35c8416..0347a7a37186b 100644
--- a/clang/include/clang/Lex/MacroInfo.h
+++ b/clang/include/clang/Lex/MacroInfo.h
@@ -521,7 +521,7 @@ class ModuleMacro : public llvm::FoldingSetNode {
   }
 
   static void Profile(llvm::FoldingSetNodeID &ID, Module *OwningModule,
-                      IdentifierInfo *II) {
+                      const IdentifierInfo *II) {
     ID.AddPointer(OwningModule);
     ID.AddPointer(II);
   }

diff  --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index e34e35be30b37..d89c4753f8d1a 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -1151,7 +1151,7 @@ class Preprocessor {
   /// Register an exported macro for a module and identifier.
   ModuleMacro *addModuleMacro(Module *Mod, IdentifierInfo *II, MacroInfo *Macro,
                               ArrayRef<ModuleMacro *> Overrides, bool &IsNew);
-  ModuleMacro *getModuleMacro(Module *Mod, IdentifierInfo *II);
+  ModuleMacro *getModuleMacro(Module *Mod, const IdentifierInfo *II);
 
   /// Get the list of leaf (non-overridden) module macros for a name.
   ArrayRef<ModuleMacro*> getLeafModuleMacros(const IdentifierInfo *II) const {

diff  --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index f04d896247c98..252697b2fd35a 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -124,7 +124,7 @@ static bool isReservedId(StringRef Text, const LangOptions &Lang) {
 // the specified module, meaning clang won't build the specified module. This is
 // useful in a number of situations, for instance, when building a library that
 // vends a module map, one might want to avoid hitting intermediate build
-// products containimg the the module map or avoid finding the system installed
+// products containing the the module map or avoid finding the system installed
 // modulemap for that library.
 static bool isForModuleBuilding(Module *M, StringRef CurrentModule,
                                 StringRef ModuleName) {

diff  --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 43d31d6c5732e..9528a8f575f0c 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -170,7 +170,8 @@ ModuleMacro *Preprocessor::addModuleMacro(Module *Mod, IdentifierInfo *II,
   return MM;
 }
 
-ModuleMacro *Preprocessor::getModuleMacro(Module *Mod, IdentifierInfo *II) {
+ModuleMacro *Preprocessor::getModuleMacro(Module *Mod,
+                                          const IdentifierInfo *II) {
   llvm::FoldingSetNodeID ID;
   ModuleMacro::Profile(ID, Mod, II);
 


        


More information about the cfe-commits mailing list