[PATCH] D57874: [WebAssembly] Set '-matomics' when '-pthread' is set

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 7 16:55:00 PST 2019


aheejin updated this revision to Diff 185895.
aheejin added a comment.

Sorry nevermind my previous code. There was not hacky and much cleaner way to do everything in the driver layer. (Before I tried to do everything in the cc1 compilation layer :( )

Anyway, moved all logic to the driver layer and did this:

- `-matomics` means `-mthread-model posix`
- `-mthread-model posix` means `-matomics`
- `-pthread` means both `-matomics` and `-mthread-model posix`

It currently does not check mismatches and crash. If either of `-matomics` or `-mthread-model posix` is set it is gonna set both. THe same for `-pthread`. Not sure which flag is the *canonical* one to trust.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57874/new/

https://reviews.llvm.org/D57874

Files:
  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/Driver/wasm-toolchain.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57874.185895.patch
Type: text/x-patch
Size: 7151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190208/3a2e35e6/attachment.bin>


More information about the cfe-commits mailing list