forked from OSchip/llvm-project
Added transfer function support for casting to "void".
llvm-svn: 47333
This commit is contained in:
parent
a0b1cc41ef
commit
fe0b5740ce
|
@ -449,8 +449,9 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* E, NodeTy* Pred, NodeSet& Dst) {
|
|||
|
||||
QualType T = CastE->getType();
|
||||
|
||||
// Check for redundant casts.
|
||||
if (E->getType() == T ||
|
||||
// Check for redundant casts or casting to "void"
|
||||
if (T->isVoidType() ||
|
||||
E->getType() == T ||
|
||||
(T->isPointerType() && E->getType()->isFunctionType())) {
|
||||
Dst.Add(Pred);
|
||||
return;
|
||||
|
|
|
@ -252,6 +252,10 @@ RValue ValueStateManager::GetValue(ValueState St, Expr* E, bool* hasVal) {
|
|||
case Stmt::ImplicitCastExprClass: {
|
||||
ImplicitCastExpr* C = cast<ImplicitCastExpr>(E);
|
||||
QualType CT = C->getType();
|
||||
|
||||
if (CT->isVoidType())
|
||||
return UnknownVal();
|
||||
|
||||
QualType ST = C->getSubExpr()->getType();
|
||||
|
||||
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
|
||||
|
@ -266,6 +270,9 @@ RValue ValueStateManager::GetValue(ValueState St, Expr* E, bool* hasVal) {
|
|||
QualType CT = C->getType();
|
||||
QualType ST = C->getSubExpr()->getType();
|
||||
|
||||
if (CT->isVoidType())
|
||||
return UnknownVal();
|
||||
|
||||
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
|
||||
E = C->getSubExpr();
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue