]> granicus.if.org Git - clang/commit
[WebAssembly] Make thread-related options consistent
authorHeejin Ahn <aheejin@gmail.com>
Mon, 11 Feb 2019 22:47:50 +0000 (22:47 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Mon, 11 Feb 2019 22:47:50 +0000 (22:47 +0000)
commita9cda1ceeb19ccd00f6fab26209d8e07db44424b
tree4a4f12681be86e74ddcef45e44317cb34b00f0c0
parentef5bc382a1aec774a1ea5600ce19f0781758ef8e
[WebAssembly] Make thread-related options consistent

Summary:
There have been three options related to threads and users had to set
all three of them separately to get the correct compilation results.
This makes sure the relationship between the options makes sense and
sets necessary options for users if only part of the necessary options
are specified. This does:

- Remove `-matomics`; this option alone does not enable anything, so
  removed it to not confuse users.
- `-mthread-model posix` sets `-target-feature +atomics`
- `-pthread` sets both `-target-feature +atomics` and
  `-mthread-model posix`
Also errors out when explicitly given options don't match, such as
`-pthread` is given with `-mthread-model single`.

Reviewers: dschuff, sbc100, tlively, sunfish

Subscribers: jgravelle-google, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D57874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353761 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
include/clang/Driver/ToolChain.h
lib/Driver/Driver.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Driver/ToolChains/WebAssembly.cpp
lib/Driver/ToolChains/WebAssembly.h
test/Driver/wasm-toolchain.c
test/Preprocessor/wasm-target-features.c