XCOFFObjectWriter - silence static analyzer dyn_cast<> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 374788
This commit is contained in:
Simon Pilgrim 2019-10-14 16:46:11 +00:00
parent 0e100037d7
commit ef0cb27180
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ void XCOFFObjectWriter::executePostLayoutBinding(
DenseMap<const MCSectionXCOFF *, ControlSection *> WrapperMap;
for (const auto &S : Asm) {
const MCSectionXCOFF *MCSec = dyn_cast<const MCSectionXCOFF>(&S);
const auto *MCSec = cast<const MCSectionXCOFF>(&S);
assert(WrapperMap.find(MCSec) == WrapperMap.end() &&
"Cannot add a csect twice.");