summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/WebAssembly.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-07-12 18:23:13 +0000
committerThomas Lively <tlively@google.com>2019-07-12 18:23:13 +0000
commitdb8e36481a2189422e60b00b709dbfb684074fc4 (patch)
treefee493fb1771fade7914d0591fe9b209071c6f14 /clang/lib/Driver/ToolChains/WebAssembly.cpp
parentff26aed0d1c9766305c41750db1e261feb7f68a1 (diff)
downloadbcm5719-llvm-db8e36481a2189422e60b00b709dbfb684074fc4.tar.gz
bcm5719-llvm-db8e36481a2189422e60b00b709dbfb684074fc4.zip
[WebAssembly] Make pthread imply bulk-memory, mutable-globals
Summary: This paves the way for using passive segments in pthread builds, which will make separate memory files unnecessary. Mutable globals are also necessary for the upcoming implementation of TLS. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64586 llvm-svn: 365935
Diffstat (limited to 'clang/lib/Driver/ToolChains/WebAssembly.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/WebAssembly.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/WebAssembly.cpp b/clang/lib/Driver/ToolChains/WebAssembly.cpp
index 648e5b3a94c..7a40c13c065 100644
--- a/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ b/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -141,7 +141,7 @@ void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs,
options::OPT_fno_use_init_array, true))
CC1Args.push_back("-fuse-init-array");
- // '-pthread' implies '-target-feature +atomics'
+ // '-pthread' implies atomics, bulk-memory, and mutable-globals
if (DriverArgs.hasFlag(options::OPT_pthread, options::OPT_no_pthread,
false)) {
if (DriverArgs.hasFlag(options::OPT_mno_atomics, options::OPT_matomics,
@@ -149,8 +149,22 @@ void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs,
getDriver().Diag(diag::err_drv_argument_not_allowed_with)
<< "-pthread"
<< "-mno-atomics";
+ if (DriverArgs.hasFlag(options::OPT_mno_bulk_memory,
+ options::OPT_mbulk_memory, false))
+ getDriver().Diag(diag::err_drv_argument_not_allowed_with)
+ << "-pthread"
+ << "-mno-bulk-memory";
+ if (DriverArgs.hasFlag(options::OPT_mno_mutable_globals,
+ options::OPT_mmutable_globals, false))
+ getDriver().Diag(diag::err_drv_argument_not_allowed_with)
+ << "-pthread"
+ << "-mno-mutable-globals";
CC1Args.push_back("-target-feature");
CC1Args.push_back("+atomics");
+ CC1Args.push_back("-target-feature");
+ CC1Args.push_back("+bulk-memory");
+ CC1Args.push_back("-target-feature");
+ CC1Args.push_back("+mutable-globals");
}
}
OpenPOWER on IntegriCloud