From 46755a96f6909bd941235bebc090498ccdfd66ff Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Thu, 27 Apr 2017 09:56:39 +0000 Subject: [PATCH] Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301526 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/MacroInfo.h | 4 ++-- lib/Lex/MacroInfo.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h index 6cc3b0bb26..44b7b2e4a4 100644 --- a/include/clang/Lex/MacroInfo.h +++ b/include/clang/Lex/MacroInfo.h @@ -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()); diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp index 924613dcb8..bec434085e 100644 --- a/lib/Lex/MacroInfo.cpp +++ b/lib/Lex/MacroInfo.cpp @@ -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; -- 2.40.0