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;
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;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits