[clang][WebAssemmbly] Call TargetInfo::adjust in derived method.

The superclass method handles a bunch of useful things. For example
it applies flags such as `-fnew-alignment` which doesn't work without
this patch.

Differential Revision: https://reviews.llvm.org/D118573
This commit is contained in:
Sam Clegg 2022-01-30 11:10:59 -08:00
parent 389f67b35b
commit ecbcefd693
2 changed files with 2 additions and 0 deletions

View File

@ -255,6 +255,7 @@ ArrayRef<Builtin::Info> WebAssemblyTargetInfo::getTargetBuiltins() const {
void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags,
LangOptions &Opts) {
TargetInfo::adjust(Diags, Opts);
// If the Atomics feature isn't available, turn off POSIXThreads and
// ThreadModel, so that we don't predefine _REENTRANT or __STDCPP_THREADS__.
if (!HasAtomics) {

View File

@ -1,6 +1,7 @@
// RUN: %clang_cc1 -std=c++1z %s -verify -triple x86_64-linux-gnu -DALIGN=16
// RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=2 -DALIGN=2
// RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=256 -DALIGN=256
// RUN: %clang_cc1 -std=c++1z %s -verify -triple wasm32-unknown-unknown -fnew-alignment=256 -DALIGN=256
// expected-no-diagnostics