mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-08 21:10:35 +00:00
[MC] Generalize MCContext's SectionSymbols field.
Change SectionSymbols so that it doesn't hard-code ELF types, so that it can be used for non-ELF targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
728c815331
commit
bbaf9cd246
@ -82,9 +82,9 @@ namespace llvm {
|
||||
/// Bindings of names to symbols.
|
||||
SymbolTable Symbols;
|
||||
|
||||
/// ELF sections can have a corresponding symbol. This maps one to the
|
||||
/// Sections can have a corresponding symbol. This maps one to the
|
||||
/// other.
|
||||
DenseMap<const MCSectionELF *, MCSymbolELF *> SectionSymbols;
|
||||
DenseMap<const MCSection *, MCSymbol *> SectionSymbols;
|
||||
|
||||
/// A mapping from a local label number and an instance count to a symbol.
|
||||
/// For example, in the assembly
|
||||
|
@ -125,15 +125,15 @@ MCSymbol *MCContext::getOrCreateSymbol(const Twine &Name) {
|
||||
}
|
||||
|
||||
MCSymbolELF *MCContext::getOrCreateSectionSymbol(const MCSectionELF &Section) {
|
||||
MCSymbolELF *&Sym = SectionSymbols[&Section];
|
||||
MCSymbol *&Sym = SectionSymbols[&Section];
|
||||
if (Sym)
|
||||
return Sym;
|
||||
return cast<MCSymbolELF>(Sym);
|
||||
|
||||
StringRef Name = Section.getSectionName();
|
||||
auto NameIter = UsedNames.insert(std::make_pair(Name, false)).first;
|
||||
Sym = new (&*NameIter, *this) MCSymbolELF(&*NameIter, /*isTemporary*/ false);
|
||||
|
||||
return Sym;
|
||||
return cast<MCSymbolELF>(Sym);
|
||||
}
|
||||
|
||||
MCSymbol *MCContext::getOrCreateFrameAllocSymbol(StringRef FuncName,
|
||||
|
Loading…
Reference in New Issue
Block a user