summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristof Umann <dkszelethus@gmail.com>2018-10-31 17:19:20 +0000
committerKristof Umann <dkszelethus@gmail.com>2018-10-31 17:19:20 +0000
commit20c21b7b6835ec96fbe9810c3e51b4777818d616 (patch)
tree4057dacb8fb09de7a434d472ffdef575145a4dc4
parente8be1bee43603c8a42950c8f855c8891b2167eb8 (diff)
[Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager
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
-rw-r--r--include/clang/Lex/MacroInfo.h3
-rw-r--r--lib/Lex/MacroInfo.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h
index 0cc1cb92e6..a06de132b4 100644
--- a/include/clang/Lex/MacroInfo.h
+++ b/include/clang/Lex/MacroInfo.h
@@ -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;
diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp
index 4ed69ecc46..434c120075 100644
--- a/lib/Lex/MacroInfo.cpp
+++ b/lib/Lex/MacroInfo.cpp
@@ -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.