summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-04-19 18:06:33 +0000
committerSanjay Patel <spatel@rotateright.com>2016-04-19 18:06:33 +0000
commit3fd323fa36ccac8e87a15410f14ef8990f679227 (patch)
treec88f19fe0f1100a1a112aea2cd8b7d21b33a7eec
parent9738602869dda75509a0f3782cd6639f9e3927c4 (diff)
downloadbcm5719-llvm-3fd323fa36ccac8e87a15410f14ef8990f679227.tar.gz
bcm5719-llvm-3fd323fa36ccac8e87a15410f14ef8990f679227.zip
reduce indentation; NFCI
llvm-svn: 266787
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 6b135a917b5..29a513f2bdf 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1313,15 +1313,12 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond,
// create metadata that specifies that the branch is unpredictable.
// Don't bother if not optimizing because that metadata would not be used.
llvm::MDNode *Unpredictable = nullptr;
- if (CGM.getCodeGenOpts().OptimizationLevel != 0) {
- if (const CallExpr *Call = dyn_cast<CallExpr>(Cond)) {
- const Decl *TargetDecl = Call->getCalleeDecl();
- if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl)) {
- if (FD->getBuiltinID() == Builtin::BI__builtin_unpredictable) {
- llvm::MDBuilder MDHelper(getLLVMContext());
- Unpredictable = MDHelper.createUnpredictable();
- }
- }
+ auto *Call = dyn_cast<CallExpr>(Cond);
+ if (Call && CGM.getCodeGenOpts().OptimizationLevel != 0) {
+ auto *FD = dyn_cast_or_null<FunctionDecl>(Call->getCalleeDecl());
+ if (FD && FD->getBuiltinID() == Builtin::BI__builtin_unpredictable) {
+ llvm::MDBuilder MDHelper(getLLVMContext());
+ Unpredictable = MDHelper.createUnpredictable();
}
}
OpenPOWER on IntegriCloud