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];
|
const RelTy &Rel = Rels[FirstRelI];
|
||||||
SymbolBody &B = Sec->template getFile<ELFT>()->getRelocTargetSym(Rel);
|
SymbolBody &B = Sec->template getFile<ELFT>()->getRelocTargetSym(Rel);
|
||||||
auto *D = dyn_cast<DefinedRegular>(&B);
|
if (auto *D = dyn_cast<DefinedRegular>(&B))
|
||||||
if (!D || !D->Section)
|
if (D->Section)
|
||||||
return false;
|
return cast<InputSectionBase>(D->Section)->Repl->Live;
|
||||||
auto *Target =
|
return false;
|
||||||
cast<InputSectionBase>(cast<InputSectionBase>(D->Section)->Repl);
|
|
||||||
return Target && Target->Live;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// .eh_frame is a sequence of CIE or FDE records. In general, there
|
// .eh_frame is a sequence of CIE or FDE records. In general, there
|
||||||
|
|
Loading…
Reference in New Issue