[cfe-commits] r167790 - /cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
Anna Zaks
ganna at apple.com
Mon Nov 12 16:13:44 PST 2012
Author: zaks
Date: Mon Nov 12 18:13:44 2012
New Revision: 167790
URL: http://llvm.org/viewvc/llvm-project?rev=167790&view=rev
Log:
[analyzer] Address Jordan's feedback for r167780.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp?rev=167790&r1=167789&r2=167790&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Mon Nov 12 18:13:44 2012
@@ -191,12 +191,13 @@
currBldrCtx = 0;
}
-static bool isDifferentDeclUsedAtRuntime(CallEventRef<> Call,
+static bool wasDifferentDeclUsedForInlining(CallEventRef<> Call,
const StackFrameContext *calleeCtx) {
const Decl *RuntimeCallee = calleeCtx->getDecl();
const Decl *StaticDecl = Call->getDecl();
- if (!RuntimeCallee || !StaticDecl)
- return false;
+ assert(RuntimeCallee);
+ if (!StaticDecl)
+ return true;
return RuntimeCallee->getCanonicalDecl() != StaticDecl->getCanonicalDecl();
}
@@ -240,7 +241,7 @@
SVal V = state->getSVal(RS, LCtx);
// Ensure that the return type matches the type of the returned Expr.
- if (isDifferentDeclUsedAtRuntime(Call, calleeCtx)) {
+ if (wasDifferentDeclUsedForInlining(Call, calleeCtx)) {
QualType ReturnedTy =
CallEvent::getDeclaredResultType(calleeCtx->getDecl());
if (!ReturnedTy.isNull()) {
More information about the cfe-commits
mailing list