forked from OSchip/llvm-project
[analyzer] NFC: Remove dead checks when computing DeclStmt construction region.
In CFG, every DeclStmt has exactly one decl, which is always a variable. It is also pointless to check that the initializer is the constructor because that's how construction contexts work now. llvm-svn: 325201
This commit is contained in:
parent
b7b86127f5
commit
e231bd342e
|
@ -138,15 +138,12 @@ ExprEngine::getRegionForConstructedObject(const CXXConstructExpr *CE,
|
|||
}
|
||||
}
|
||||
} else if (auto *DS = dyn_cast<DeclStmt>(TriggerStmt)) {
|
||||
if (const auto *Var = dyn_cast<VarDecl>(DS->getSingleDecl())) {
|
||||
if (Var->getInit() && Var->getInit()->IgnoreImplicit() == CE) {
|
||||
SVal LValue = State->getLValue(Var, LCtx);
|
||||
QualType Ty = Var->getType();
|
||||
LValue = makeZeroElementRegion(
|
||||
State, LValue, Ty, CallOpts.IsArrayConstructorOrDestructor);
|
||||
return LValue.getAsRegion();
|
||||
}
|
||||
}
|
||||
const auto *Var = cast<VarDecl>(DS->getSingleDecl());
|
||||
SVal LValue = State->getLValue(Var, LCtx);
|
||||
QualType Ty = Var->getType();
|
||||
LValue = makeZeroElementRegion(State, LValue, Ty,
|
||||
CallOpts.IsArrayConstructorOrDestructor);
|
||||
return LValue.getAsRegion();
|
||||
}
|
||||
// TODO: Consider other directly initialized elements.
|
||||
} else if (const CXXCtorInitializer *Init = CC->getTriggerInit()) {
|
||||
|
|
Loading…
Reference in New Issue