Descriptor *D = P.createDescriptor(Src, Ty, Descriptor::InlineDescMD, IsConst,
Src.is<const Expr *>());
Scope::Local Local = this->createLocal(D);
- if (auto *VD = dyn_cast_or_null<ValueDecl>(Src.dyn_cast<const Decl *>()))
+ if (auto *VD = dyn_cast_if_present<ValueDecl>(Src.dyn_cast<const Decl *>()))
Locals.insert({VD, Local});
VarScope->add(Local, IsExtended);
return Local.Offset;
return VisitBuiltinCallExpr(E);
const Decl *Callee = E->getCalleeDecl();
- if (const auto *FuncDecl = dyn_cast_or_null<FunctionDecl>(Callee)) {
+ if (const auto *FuncDecl = dyn_cast_if_present<FunctionDecl>(Callee)) {
const Function *Func = getFunction(FuncDecl);
if (!Func)
return false;
const SourceInfo &Loc = S.Current->getSource(OpPC);
bool IsImplicit = false;
- if (auto *E = dyn_cast_or_null<CXXThisExpr>(Loc.asExpr()))
+ if (auto *E = dyn_cast_if_present<CXXThisExpr>(Loc.asExpr()))
IsImplicit = E->isImplicit();
if (S.getLangOpts().CPlusPlus11)
// Use a different note for an inheriting constructor, because from the
// user's perspective it's not really a function at all.
- if (auto *CD = dyn_cast_or_null<CXXConstructorDecl>(F->getCallee())) {
+ if (auto *CD = dyn_cast_if_present<CXXConstructorDecl>(F->getCallee())) {
if (CD->isInheritingConstructor()) {
addDiag(CallLocation, diag::note_constexpr_inherited_ctor_call_here)
<< CD->getParent();