[PATCH] D53940: [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 31 10:13:17 PDT 2018


Szelethus created this revision.
Szelethus added a reviewer: dblaikie.
Herald added subscribers: cfe-commits, dkrupp.

I'm currently working on including macro expansions in the Static Analyzer's plist output, where I can only access a `const SourceManager`.


Repository:
  rC Clang

https://reviews.llvm.org/D53940

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


Index: lib/Lex/MacroInfo.cpp
===================================================================
--- lib/Lex/MacroInfo.cpp
+++ lib/Lex/MacroInfo.cpp
@@ -200,7 +200,8 @@
 }
 
 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.
Index: include/clang/Lex/MacroInfo.h
===================================================================
--- include/clang/Lex/MacroInfo.h
+++ include/clang/Lex/MacroInfo.h
@@ -395,7 +395,8 @@
 
   /// 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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53940.171953.patch
Type: text/x-patch
Size: 1182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181031/fdfa3f7b/attachment.bin>


More information about the cfe-commits mailing list