aprantl added inline comments.
> ReachableCode.cpp:64
> + const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(DRE->getDecl());
> + return FDecl && FDecl->getIdentifier() &&
> + FDecl->getBuiltinID() == Builtin::BI__builtin_unreachable;
Maybe also wrap the inner dyn_cast in an if for symmetry?
static bool isBuiltinUnreachable(const Stmt *S) {
if (const auto *DRE = dyn_cast<DeclRefExpr>(S))
if (const auto *FDecl = dyn_cast<FunctionDecl>(DRE->getDecl()))
return FDecl->getIdentifier() &&
FDecl->getBuiltinID() == Builtin::BI__builtin_unreachable;
return false;
}
Repository:
rL LLVM
https://reviews.llvm.org/D25321
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits