summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-12-03 23:55:57 +0000
committerDan Gohman <dan433584@gmail.com>2016-12-03 23:55:57 +0000
commitabceeeee5d6375032278c9821f3724edf0d9f693 (patch)
treecc5c9130a8aa825b99bc05510ed687deda9d1d47 /llvm/lib/MC/MCContext.cpp
parentc3aacfd91bcf41a122c64b21c39f85cb72a1b333 (diff)
downloadbcm5719-llvm-abceeeee5d6375032278c9821f3724edf0d9f693.tar.gz
bcm5719-llvm-abceeeee5d6375032278c9821f3724edf0d9f693.zip
[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. llvm-svn: 288607
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 77fe015eefe..afe8ee84918 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -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,
OpenPOWER on IntegriCloud