[clang] ecbcefd - [clang][WebAssemmbly] Call TargetInfo::adjust in derived method.
Sam Clegg via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 10 16:04:15 PST 2022
Author: Sam Clegg
Date: 2022-02-10T16:04:06-08:00
New Revision: ecbcefd693dd62f9242618b3cf838565e829cc7f
URL: https://github.com/llvm/llvm-project/commit/ecbcefd693dd62f9242618b3cf838565e829cc7f
DIFF: https://github.com/llvm/llvm-project/commit/ecbcefd693dd62f9242618b3cf838565e829cc7f.diff
LOG: [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
Added:
Modified:
clang/lib/Basic/Targets/WebAssembly.cpp
clang/test/CXX/cpp/cpp.predefined/p1.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp
index 2309997eb77b2..023c03c7cf5c0 100644
--- a/clang/lib/Basic/Targets/WebAssembly.cpp
+++ b/clang/lib/Basic/Targets/WebAssembly.cpp
@@ -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) {
diff --git a/clang/test/CXX/cpp/cpp.predefined/p1.cpp b/clang/test/CXX/cpp/cpp.predefined/p1.cpp
index c0dcbd54f3873..42a80d37c43d1 100644
--- a/clang/test/CXX/cpp/cpp.predefined/p1.cpp
+++ b/clang/test/CXX/cpp/cpp.predefined/p1.cpp
@@ -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
More information about the cfe-commits
mailing list