]> granicus.if.org Git - clang/commitdiff
[Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager
authorKristof Umann <dkszelethus@gmail.com>
Wed, 31 Oct 2018 17:19:20 +0000 (17:19 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Wed, 31 Oct 2018 17:19:20 +0000 (17:19 +0000)
I'm currently working on including macro expansions in the Static Analyzer's
plist output, where I can only access a const SourceManager.

Differential Revision: https://reviews.llvm.org/D53940

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345741 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 0cc1cb92e67e7646f98ceb4bd07a0956a51c46ac..a06de132b49698ce1dc6565f83e3e92262b78543 100644 (file)
@@ -395,7 +395,8 @@ public:
 
   /// Find macro definition active in the specified source location. If
   /// this macro was not defined there, return NULL.
-  const DefInfo findDirectiveAtLoc(SourceLocation L, SourceManager &SM) const;
+  const DefInfo findDirectiveAtLoc(SourceLocation L,
+                                   const SourceManager &SM) const;
 
   void dump() const;
 
index 4ed69ecc465db93603d68c2bb49db1863058c8f3..434c1200759647802bee3d2be4a1fa43b68b11e3 100644 (file)
@@ -200,7 +200,8 @@ MacroDirective::DefInfo MacroDirective::getDefinition() {
 }
 
 const MacroDirective::DefInfo
-MacroDirective::findDirectiveAtLoc(SourceLocation L, SourceManager &SM) const {
+MacroDirective::findDirectiveAtLoc(SourceLocation L,
+                                   const SourceManager &SM) const {
   assert(L.isValid() && "SourceLocation is invalid.");
   for (DefInfo Def = getDefinition(); Def; Def = Def.getPreviousDefinition()) {
     if (Def.getLocation().isInvalid() ||  // For macros defined on the command line.