diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-05 22:59:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-05 22:59:42 +0000 |
commit | 55aea31ee3d35a05387b4eddb13c7b19408c8cf6 (patch) | |
tree | bb9bb97a42e42cf68c49f13a59c9ac542bff0828 | |
parent | 5dc7f8b2d6a4f94ab4d1377912499a23cf8bc024 (diff) |
Added transfer function support for __builtin_expect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47971 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Analysis/GRExprEngine.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp index fa623a49e4..3b4b787d6a 100644 --- a/Analysis/GRExprEngine.cpp +++ b/Analysis/GRExprEngine.cpp @@ -517,8 +517,21 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, IdentifierInfo* Info = cast<lval::FuncVal>(L).getDecl()->getIdentifier(); - if (Info->getBuiltinID()) - invalidateArgs = true; + if (unsigned id = Info->getBuiltinID()) { + switch (id) { + case Builtin::BI__builtin_expect: { + // For __builtin_expect, just return the value of the subexpression. + assert (CE->arg_begin() != CE->arg_end()); + RVal X = GetRVal(St, *(CE->arg_begin())); + Nodify(Dst, CE, *DI, SetRVal(St, CE, X)); + continue; + } + + default: + invalidateArgs = true; + break; + } + } } if (invalidateArgs) { |