forked from OSchip/llvm-project
[MC] Merge MCSymbol::getSectionPtr into getSection and simplify
This commit is contained in:
parent
c764304adc
commit
124b918bd3
|
@ -178,14 +178,6 @@ private:
|
|||
llvm_unreachable("Constructor throws?");
|
||||
}
|
||||
|
||||
MCSection *getSectionPtr() const {
|
||||
if (MCFragment *F = getFragment()) {
|
||||
assert(F != AbsolutePseudoFragment);
|
||||
return F->getParent();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// Get a reference to the name field. Requires that we have a name
|
||||
const StringMapEntry<bool> *&getNameEntryPtr() {
|
||||
assert(FragmentAndHasName.getInt() && "Name is required");
|
||||
|
@ -267,7 +259,7 @@ public:
|
|||
/// Get the section associated with a defined, non-absolute symbol.
|
||||
MCSection &getSection() const {
|
||||
assert(isInSection() && "Invalid accessor!");
|
||||
return *getSectionPtr();
|
||||
return *getFragment()->getParent();
|
||||
}
|
||||
|
||||
/// Mark the symbol as defined in the fragment \p F.
|
||||
|
|
Loading…
Reference in New Issue