Skip to content

Commit ecbcefd

Browse files
committed
[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
1 parent 389f67b commit ecbcefd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

clang/lib/Basic/Targets/WebAssembly.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ ArrayRef<Builtin::Info> WebAssemblyTargetInfo::getTargetBuiltins() const {
255255

256256
void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags,
257257
LangOptions &Opts) {
258+
TargetInfo::adjust(Diags, Opts);
258259
// If the Atomics feature isn't available, turn off POSIXThreads and
259260
// ThreadModel, so that we don't predefine _REENTRANT or __STDCPP_THREADS__.
260261
if (!HasAtomics) {

clang/test/CXX/cpp/cpp.predefined/p1.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clang_cc1 -std=c++1z %s -verify -triple x86_64-linux-gnu -DALIGN=16
22
// RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=2 -DALIGN=2
33
// RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=256 -DALIGN=256
4+
// RUN: %clang_cc1 -std=c++1z %s -verify -triple wasm32-unknown-unknown -fnew-alignment=256 -DALIGN=256
45

56
// expected-no-diagnostics
67

0 commit comments

Comments
 (0)