From 2bb217b5fec3e3b98c25a2d5d8d88f3a0b245a2c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 2 Oct 2019 11:48:17 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp') 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(MD)) { + if (auto *DGV = dyn_cast(MD)) { auto *DGVE = DIGlobalVariableExpression::getDistinct( Context, DGV, DIExpression::get(Context, {})); GV.addMetadata(LLVMContext::MD_dbg, *DGVE); -- cgit v1.2.3