r301526 - Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC.

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 27 02:56:40 PDT 2017


Author: yrnkrn
Date: Thu Apr 27 04:56:39 2017
New Revision: 301526

URL: http://llvm.org/viewvc/llvm-project?rev=301526&view=rev
Log:
Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC.


Modified:
    cfe/trunk/include/clang/Lex/MacroInfo.h
    cfe/trunk/lib/Lex/MacroInfo.cpp

Modified: cfe/trunk/include/clang/Lex/MacroInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/MacroInfo.h?rev=301526&r1=301525&r2=301526&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/MacroInfo.h (original)
+++ cfe/trunk/include/clang/Lex/MacroInfo.h Thu Apr 27 04:56:39 2017
@@ -126,7 +126,7 @@ public:
   SourceLocation getDefinitionEndLoc() const { return EndLocation; }
 
   /// \brief Get length in characters of the macro definition.
-  unsigned getDefinitionLength(SourceManager &SM) const {
+  unsigned getDefinitionLength(const SourceManager &SM) const {
     if (IsDefinitionLengthCached)
       return DefinitionLength;
     return getDefinitionLengthSlow(SM);
@@ -285,7 +285,7 @@ public:
   void dump() const;
 
 private:
-  unsigned getDefinitionLengthSlow(SourceManager &SM) const;
+  unsigned getDefinitionLengthSlow(const SourceManager &SM) const;
 
   void setOwningModuleID(unsigned ID) {
     assert(isFromASTFile());

Modified: cfe/trunk/lib/Lex/MacroInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/MacroInfo.cpp?rev=301526&r1=301525&r2=301526&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/MacroInfo.cpp (original)
+++ cfe/trunk/lib/Lex/MacroInfo.cpp Thu Apr 27 04:56:39 2017
@@ -33,7 +33,7 @@ MacroInfo::MacroInfo(SourceLocation DefL
     UsedForHeaderGuard(false) {
 }
 
-unsigned MacroInfo::getDefinitionLengthSlow(SourceManager &SM) const {
+unsigned MacroInfo::getDefinitionLengthSlow(const SourceManager &SM) const {
   assert(!IsDefinitionLengthCached);
   IsDefinitionLengthCached = true;
 




More information about the cfe-commits mailing list