diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/lib/MC/MCContext.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
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 //===----------------------------------------------------------------------===// |
