summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-02 11:48:17 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-02 11:48:17 +0000
commit2bb217b5fec3e3b98c25a2d5d8d88f3a0b245a2c (patch)
treedf5ae152df6973b57c845831cfebf643ad81bb98 /llvm
parenteed4b122eff653a8a00110ce33270e1b92ea41ca (diff)
downloadbcm5719-llvm-2bb217b5fec3e3b98c25a2d5d8d88f3a0b245a2c.tar.gz
bcm5719-llvm-2bb217b5fec3e3b98c25a2d5d8d88f3a0b245a2c.zip
MetadataLoader upgradeCUVariables() - silence static analyzer dyn_cast_or_null<> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we know that the source won't be null so just use dyn_cast, which will assert if the value somehow is actually null. llvm-svn: 373448
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 049164c7be7..4da51dda8b7 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -515,7 +515,7 @@ class MetadataLoader::MetadataLoaderImpl {
GV.getMetadata(LLVMContext::MD_dbg, MDs);
GV.eraseMetadata(LLVMContext::MD_dbg);
for (auto *MD : MDs)
- if (auto *DGV = dyn_cast_or_null<DIGlobalVariable>(MD)) {
+ if (auto *DGV = dyn_cast<DIGlobalVariable>(MD)) {
auto *DGVE = DIGlobalVariableExpression::getDistinct(
Context, DGV, DIExpression::get(Context, {}));
GV.addMetadata(LLVMContext::MD_dbg, *DGVE);
OpenPOWER on IntegriCloud