diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/MC/MCContext.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/MC/MCContext.cpp')
| -rw-r--r-- | gnu/llvm/lib/MC/MCContext.cpp | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/gnu/llvm/lib/MC/MCContext.cpp b/gnu/llvm/lib/MC/MCContext.cpp index 48ee84edb09..5c25e902bbe 100644 --- a/gnu/llvm/lib/MC/MCContext.cpp +++ b/gnu/llvm/lib/MC/MCContext.cpp @@ -486,53 +486,17 @@ MCSectionCOFF *MCContext::getAssociativeCOFFSection(MCSectionCOFF *Sec, "", 0, UniqueID); } -void MCContext::renameWasmSection(MCSectionWasm *Section, StringRef Name) { - StringRef GroupName; - assert(!Section->getGroup() && "not yet implemented"); - - unsigned UniqueID = Section->getUniqueID(); - WasmUniquingMap.erase( - WasmSectionKey{Section->getSectionName(), GroupName, UniqueID}); - auto I = WasmUniquingMap.insert(std::make_pair( - WasmSectionKey{Name, GroupName, UniqueID}, - Section)) - .first; - StringRef CachedName = I->first.SectionName; - const_cast<MCSectionWasm *>(Section)->setSectionName(CachedName); -} - -MCSectionWasm *MCContext::createWasmRelSection(const Twine &Name, unsigned Type, - unsigned Flags, - const MCSymbolWasm *Group) { - StringMap<bool>::iterator I; - bool Inserted; - std::tie(I, Inserted) = - RelSecNames.insert(std::make_pair(Name.str(), true)); - - return new (WasmAllocator.Allocate()) - MCSectionWasm(I->getKey(), Type, Flags, SectionKind::getReadOnly(), - Group, ~0, nullptr); -} - -MCSectionWasm *MCContext::getWasmNamedSection(const Twine &Prefix, - const Twine &Suffix, unsigned Type, - unsigned Flags) { - return getWasmSection(Prefix + "." + Suffix, Type, Flags, Suffix); -} - -MCSectionWasm *MCContext::getWasmSection(const Twine &Section, unsigned Type, - unsigned Flags, +MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind K, const Twine &Group, unsigned UniqueID, const char *BeginSymName) { MCSymbolWasm *GroupSym = nullptr; if (!Group.isTriviallyEmpty() && !Group.str().empty()) GroupSym = cast<MCSymbolWasm>(getOrCreateSymbol(Group)); - return getWasmSection(Section, Type, Flags, GroupSym, UniqueID, BeginSymName); + return getWasmSection(Section, K, GroupSym, UniqueID, BeginSymName); } -MCSectionWasm *MCContext::getWasmSection(const Twine &Section, unsigned Type, - unsigned Flags, +MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind Kind, const MCSymbolWasm *GroupSym, unsigned UniqueID, const char *BeginSymName) { @@ -548,14 +512,12 @@ MCSectionWasm *MCContext::getWasmSection(const Twine &Section, unsigned Type, StringRef CachedName = Entry.first.SectionName; - SectionKind Kind = SectionKind::getText(); - MCSymbol *Begin = nullptr; if (BeginSymName) Begin = createTempSymbol(BeginSymName, false); MCSectionWasm *Result = new (WasmAllocator.Allocate()) - MCSectionWasm(CachedName, Type, Flags, Kind, GroupSym, UniqueID, Begin); + MCSectionWasm(CachedName, Kind, GroupSym, UniqueID, Begin); Entry.second = Result; return Result; } |
