]> granicus.if.org Git - clang/commitdiff
Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC.
authorYaron Keren <yaron.keren@gmail.com>
Thu, 27 Apr 2017 09:56:39 +0000 (09:56 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Thu, 27 Apr 2017 09:56:39 +0000 (09:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301526 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/MacroInfo.h
lib/Lex/MacroInfo.cpp

index 6cc3b0bb26f2c354043a32e254123b458bdffc58..44b7b2e4a474b5429ecb2a5318857e4b311a973b 100644 (file)
@@ -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());
index 924613dcb8405d305456336e176015b860981a63..bec434085e3a232d8705ad382c960f8bb6cf1d6e 100644 (file)
@@ -33,7 +33,7 @@ MacroInfo::MacroInfo(SourceLocation DefLoc)
     UsedForHeaderGuard(false) {
 }
 
-unsigned MacroInfo::getDefinitionLengthSlow(SourceManager &SM) const {
+unsigned MacroInfo::getDefinitionLengthSlow(const SourceManager &SM) const {
   assert(!IsDefinitionLengthCached);
   IsDefinitionLengthCached = true;