forked from OSchip/llvm-project
Use cast instead of dyn_cast in combination with llvm_unreachable.
llvm-svn: 233456
This commit is contained in:
parent
667c152bce
commit
034f627838
|
@ -635,14 +635,13 @@ DefaultLayout<ELFT>::addAtom(const Atom *atom) {
|
|||
}
|
||||
return section->appendAtom(atom);
|
||||
}
|
||||
if (const AbsoluteAtom *absoluteAtom = dyn_cast<AbsoluteAtom>(atom)) {
|
||||
// Absolute atoms are not part of any section, they are global for the whole
|
||||
// link
|
||||
_absoluteAtoms.push_back(new (_allocator)
|
||||
lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value()));
|
||||
return _absoluteAtoms.back();
|
||||
}
|
||||
llvm_unreachable("Only absolute / defined atoms can be added here");
|
||||
|
||||
const AbsoluteAtom *absoluteAtom = cast<AbsoluteAtom>(atom);
|
||||
// Absolute atoms are not part of any section, they are global for the whole
|
||||
// link
|
||||
_absoluteAtoms.push_back(
|
||||
new (_allocator) lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value()));
|
||||
return _absoluteAtoms.back();
|
||||
}
|
||||
|
||||
/// Output sections with the same name into a OutputSection
|
||||
|
|
Loading…
Reference in New Issue