summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/IssueHash.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-04-04 21:06:41 +0000
committerNico Weber <nicolasweber@gmx.de>2019-04-04 21:06:41 +0000
commit04347d848d270737b183060b2ba488eef84d3a16 (patch)
treeffaf4b92f3c7f02498e4b188ecd4476a566f62e9 /clang/lib/StaticAnalyzer/Core/IssueHash.cpp
parentce2b61b2994bb08d3c45b958894ebff1ad4929f3 (diff)
downloadbcm5719-llvm-04347d848d270737b183060b2ba488eef84d3a16.tar.gz
bcm5719-llvm-04347d848d270737b183060b2ba488eef84d3a16.zip
Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
Requires making the llvm::MemoryBuffer* stored by SourceManager const, which in turn requires making the accessors for that return const llvm::MemoryBuffer*s and updating all call sites. The original motivation for this was to use it and fix the TODO in CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag version of createFileID, and since llvm::SourceMgr* hands out a const llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO this way actually works, but this seems like a good change on its own anyways. No intended behavior change. Differential Revision: https://reviews.llvm.org/D60247 llvm-svn: 357724
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/IssueHash.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/IssueHash.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/IssueHash.cpp b/clang/lib/StaticAnalyzer/Core/IssueHash.cpp
index 88d9cdab763..e7497f3fbda 100644
--- a/clang/lib/StaticAnalyzer/Core/IssueHash.cpp
+++ b/clang/lib/StaticAnalyzer/Core/IssueHash.cpp
@@ -120,7 +120,7 @@ static std::string GetEnclosingDeclContextSignature(const Decl *D) {
return "";
}
-static StringRef GetNthLineOfFile(llvm::MemoryBuffer *Buffer, int Line) {
+static StringRef GetNthLineOfFile(const llvm::MemoryBuffer *Buffer, int Line) {
if (!Buffer)
return "";
@@ -144,7 +144,7 @@ static std::string NormalizeLine(const SourceManager &SM, FullSourceLoc &L,
col++;
SourceLocation StartOfLine =
SM.translateLineCol(SM.getFileID(L), L.getExpansionLineNumber(), col);
- llvm::MemoryBuffer *Buffer =
+ const llvm::MemoryBuffer *Buffer =
SM.getBuffer(SM.getFileID(StartOfLine), StartOfLine);
if (!Buffer)
return {};
OpenPOWER on IntegriCloud