From 7d7e913e096a915038dd41d0bfe5dd8827da1f60 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 13 Jun 2021 13:05:17 +0100 Subject: [PATCH] SValExplainer.h - get APSInt values by const reference instead of value. NFCI. Avoid unnecessary copies. --- clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h b/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h index 0f33909..31a4ed5 100644 --- a/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h +++ b/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h @@ -65,7 +65,7 @@ public: } std::string VisitLocConcreteInt(loc::ConcreteInt V) { - llvm::APSInt I = V.getValue(); + const llvm::APSInt &I = V.getValue(); std::string Str; llvm::raw_string_ostream OS(Str); OS << "concrete memory address '" << I << "'"; @@ -77,7 +77,7 @@ public: } std::string VisitNonLocConcreteInt(nonloc::ConcreteInt V) { - llvm::APSInt I = V.getValue(); + const llvm::APSInt &I = V.getValue(); std::string Str; llvm::raw_string_ostream OS(Str); OS << (I.isSigned() ? "signed " : "unsigned ") << I.getBitWidth() -- 2.7.4