From: Zhongxing Xu Date: Mon, 26 Oct 2009 05:18:31 +0000 (+0000) Subject: 'error' is usually used as a noreturn function. This can suppress some false X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99f3b7902f39a71bd6759f39bbd072258b488092;p=clang 'error' is usually used as a noreturn function. This can suppress some false warnings. Eventually we need a way to import externally defined functions summaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85092 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 08e02feb08..b146c55d89 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1454,17 +1454,10 @@ static void MarkNoReturnFunction(const FunctionDecl *FD, CallExpr *CE, break; case 5: - if (!memcmp(s, "panic", 5)) Builder->BuildSinks = true; - else if (!memcmp(s, "error", 5)) { - if (CE->getNumArgs() > 0) { - SVal X = state->getSVal(*CE->arg_begin()); - // FIXME: use Assume to inspect the possible symbolic value of - // X. Also check the specific signature of error(). - nonloc::ConcreteInt* CI = dyn_cast(&X); - if (CI && CI->getValue() != 0) - Builder->BuildSinks = true; - } - } + if (!memcmp(s, "panic", 5)) + Builder->BuildSinks = true; + else if (!memcmp(s, "error", 5)) + Builder->BuildSinks = true; break; case 6: