diff options
Diffstat (limited to 'gnu/llvm/lib/MC/MCContext.cpp')
| -rw-r--r-- | gnu/llvm/lib/MC/MCContext.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gnu/llvm/lib/MC/MCContext.cpp b/gnu/llvm/lib/MC/MCContext.cpp index 47ed1ca3add..4798991ceed 100644 --- a/gnu/llvm/lib/MC/MCContext.cpp +++ b/gnu/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, @@ -173,7 +173,7 @@ MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix, if (CanBeUnnamed && !UseNamesOnTempLabels) return createSymbolImpl(nullptr, true); - // Determine whether this is an user writter assembler temporary or normal + // Determine whether this is a user written assembler temporary or normal // label, if used. bool IsTemporary = CanBeUnnamed; if (AllowTemporaryLabels && !IsTemporary) @@ -260,6 +260,13 @@ MCSymbol *MCContext::lookupSymbol(const Twine &Name) const { return Symbols.lookup(NameRef); } +void MCContext::setSymbolValue(MCStreamer &Streamer, + StringRef Sym, + uint64_t Val) { + auto Symbol = getOrCreateSymbol(Sym); + Streamer.EmitAssignment(Symbol, MCConstantExpr::create(Val, *this)); +} + //===----------------------------------------------------------------------===// // Section Management //===----------------------------------------------------------------------===// @@ -361,7 +368,9 @@ MCSectionELF *MCContext::getELFSection(const Twine &Section, unsigned Type, StringRef CachedName = Entry.first.SectionName; SectionKind Kind; - if (Flags & ELF::SHF_EXECINSTR) + if (Flags & ELF::SHF_ARM_PURECODE) + Kind = SectionKind::getExecuteOnly(); + else if (Flags & ELF::SHF_EXECINSTR) Kind = SectionKind::getText(); else Kind = SectionKind::getReadOnly(); @@ -494,14 +503,6 @@ CodeViewContext &MCContext::getCVContext() { return *CVContext.get(); } -unsigned MCContext::getCVFile(StringRef FileName, unsigned FileNumber) { - return getCVContext().addFile(FileNumber, FileName) ? FileNumber : 0; -} - -bool MCContext::isValidCVFileNumber(unsigned FileNumber) { - return getCVContext().isValidFileNumber(FileNumber); -} - //===----------------------------------------------------------------------===// // Error Reporting //===----------------------------------------------------------------------===// |
