summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-11 16:00:17 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-11 16:02:23 +0000
commit93431f96a7b14ff03036bae77cc0197fdc98ad52 (patch)
treecb8b07c85fa3e9c2eb3c4e61f7460a0de6f18618 /clang/lib/CodeGen/CGStmtOpenMP.cpp
parentd87a76c9dae38b2a1ef63584aee82e74490dc83b (diff)
downloadbcm5719-llvm-93431f96a7b14ff03036bae77cc0197fdc98ad52.tar.gz
bcm5719-llvm-93431f96a7b14ff03036bae77cc0197fdc98ad52.zip
Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 2590b2605ab..f9406a95764 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -5471,7 +5471,7 @@ void CodeGenFunction::EmitSimpleOMPExecutableDirective(
OMPPrivateScope LoopGlobals(CGF);
if (const auto *LD = dyn_cast<OMPLoopDirective>(&D)) {
for (const Expr *E : LD->counters()) {
- const auto *VD = dyn_cast<VarDecl>(cast<DeclRefExpr>(E)->getDecl());
+ const auto *VD = cast<VarDecl>(cast<DeclRefExpr>(E)->getDecl());
if (!VD->hasLocalStorage() && !CGF.LocalDeclMap.count(VD)) {
LValue GlobLVal = CGF.EmitLValue(E);
LoopGlobals.addPrivate(
OpenPOWER on IntegriCloud