diff options
author | Kristof Umann <dkszelethus@gmail.com> | 2019-08-13 18:48:08 +0000 |
---|---|---|
committer | Kristof Umann <dkszelethus@gmail.com> | 2019-08-13 18:48:08 +0000 |
commit | fc76d8551f54e0a8b99306741d6d818b90334d6a (patch) | |
tree | 509888ece607a34f4aed9b71e764bb625b40cb30 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | e5ade767e5d147a91eeab33c4ee7b0581b54ee34 (diff) | |
download | bcm5719-llvm-fc76d8551f54e0a8b99306741d6d818b90334d6a.tar.gz bcm5719-llvm-fc76d8551f54e0a8b99306741d6d818b90334d6a.zip |
[analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const
When I'm new to a file/codebase, I personally find C++'s strong static type
system to be a great aid. BugReporter.cpp is still painful to read however:
function calls are made with mile long parameter lists, seemingly all of them
taken with a non-const reference/pointer. This patch fixes nothing but this:
make a few things const, and hammer it until it compiles.
Differential Revision: https://reviews.llvm.org/D65382
llvm-svn: 368735
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 9cfb98ef88f..6c1c52f1a08 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1086,7 +1086,7 @@ void MallocChecker::processNewAllocation(const CXXNewExpr *NE, if (!isStandardNewDelete(NE->getOperatorNew(), C.getASTContext())) return; - ParentMap &PM = C.getLocationContext()->getParentMap(); + const ParentMap &PM = C.getLocationContext()->getParentMap(); if (!PM.isConsumedExpr(NE) && treatUnusedNewEscaped(NE)) return; |