From d40d321bcd4a497f8405014498636400e39b4d66 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 7 Dec 2012 01:54:38 +0000 Subject: [PATCH] [analyzer] Remove possible pessimizations from r169563. Thanks for reminding me about copy-elision, David. Passing references here doesn't help when we could get move construction in C++11. If we really cared, we'd use std::swap to steal the reference from the temporary arg, but it's probably not /that/ critical outside of Profile anyway. llvm-svn: 169570 --- clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | 6 ++---- .../include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h index 1570d95..1000646 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -142,12 +142,10 @@ private: protected: friend class CallEventManager; - CallEvent(const Expr *E, const ProgramStateRef &state, - const LocationContext *lctx) + CallEvent(const Expr *E, ProgramStateRef state, const LocationContext *lctx) : State(state), LCtx(lctx), Origin(E), RefCount(0) {} - CallEvent(const Decl *D, const ProgramStateRef &state, - const LocationContext *lctx) + CallEvent(const Decl *D, ProgramStateRef state, const LocationContext *lctx) : State(state), LCtx(lctx), Origin(D), RefCount(0) {} // DO NOT MAKE PUBLIC diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h index 35b6564..519924d 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -122,7 +122,7 @@ class ExplodedNode : public llvm::FoldingSetNode { public: - explicit ExplodedNode(const ProgramPoint &loc, const ProgramStateRef &state, + explicit ExplodedNode(const ProgramPoint &loc, ProgramStateRef state, bool IsSink) : Location(loc), State(state), Succs(IsSink) { assert(isSink() == IsSink); -- 2.7.4