diff options
author | Thomas Lively <tlively@google.com> | 2019-02-19 22:56:19 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2019-02-19 22:56:19 +0000 |
commit | 2e1504091e2b6e949290b4792224c4b833acda99 (patch) | |
tree | b579df67b6a3b560a5520fea45f235e069588e3b /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 8eade092497e17ad1cfbb1a7c3d9156686b229cc (diff) | |
download | llvm-2e1504091e2b6e949290b4792224c4b833acda99.zip llvm-2e1504091e2b6e949290b4792224c4b833acda99.tar.gz llvm-2e1504091e2b6e949290b4792224c4b833acda99.tar.bz2 |
[WebAssembly] Update MC for bulk memory
Summary:
Rename MemoryIndex to InitFlags and implement logic for determining
data segment layout in ObjectYAML and MC. Also adds a "passive" flag
for the .section assembler directive although this cannot be assembled
yet because the assembler does not support data sections.
Reviewers: sbc100, aardappel, aheejin, dschuff
Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57938
llvm-svn: 354397
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a7cdcee..c50c647 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -1693,8 +1693,14 @@ MCSection *TargetLoweringObjectFileWasm::getExplicitSectionGlobal( Group = C->getName(); } - return getContext().getWasmSection(Name, Kind, Group, - MCContext::GenericSectionID); + MCSectionWasm* Section = + getContext().getWasmSection(Name, Kind, Group, + MCContext::GenericSectionID); + + if (TM.Options.ThreadModel != ThreadModel::Single) + Section->setPassive(); + + return Section; } static MCSectionWasm *selectWasmSectionForGlobal( @@ -1723,7 +1729,12 @@ static MCSectionWasm *selectWasmSectionForGlobal( UniqueID = *NextUniqueID; (*NextUniqueID)++; } - return Ctx.getWasmSection(Name, Kind, Group, UniqueID); + + MCSectionWasm* Section = Ctx.getWasmSection(Name, Kind, Group, UniqueID); + if (Section->isWasmData() && TM.Options.ThreadModel != ThreadModel::Single) + Section->setPassive(); + + return Section; } MCSection *TargetLoweringObjectFileWasm::SelectSectionForGlobal( |