Remove redundant cast<> and null check.
"Repl" member is guranteed to have a non-null pointer. If an input section is not merged by ICF, "Repl" points to "this". Otherwise, it points to some other section. It must not be NULL. llvm-svn: 313556
This commit is contained in:
parent
307e039d8c
commit
27a357c9d9
|
@ -446,12 +446,10 @@ bool EhFrameSection<ELFT>::isFdeLive(EhSectionPiece &Piece,
|
|||
|
||||
const RelTy &Rel = Rels[FirstRelI];
|
||||
SymbolBody &B = Sec->template getFile<ELFT>()->getRelocTargetSym(Rel);
|
||||
auto *D = dyn_cast<DefinedRegular>(&B);
|
||||
if (!D || !D->Section)
|
||||
return false;
|
||||
auto *Target =
|
||||
cast<InputSectionBase>(cast<InputSectionBase>(D->Section)->Repl);
|
||||
return Target && Target->Live;
|
||||
if (auto *D = dyn_cast<DefinedRegular>(&B))
|
||||
if (D->Section)
|
||||
return cast<InputSectionBase>(D->Section)->Repl->Live;
|
||||
return false;
|
||||
}
|
||||
|
||||
// .eh_frame is a sequence of CIE or FDE records. In general, there
|
||||
|
|
Loading…
Reference in New Issue