Skip to content

Commit 0b5d2b0

Browse files
committed
[WebAssembly] Remove dependency of reference types from EH
The new spec does not have `exnref` so EH does not have dependency of the reference types proposal anymore. Reviewed By: dschuff Differential Revision: https://reviews.llvm.org/D96903
1 parent a8d9d50 commit 0b5d2b0

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

clang/lib/Driver/ToolChains/WebAssembly.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,6 @@ void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs,
282282
getDriver().Diag(diag::err_drv_argument_not_allowed_with)
283283
<< "-fwasm-exceptions"
284284
<< "-mno-exception-handling";
285-
// '-fwasm-exceptions' is not compatible with '-mno-reference-types'
286-
if (DriverArgs.hasFlag(options::OPT_mno_reference_types,
287-
options::OPT_mexception_handing, false))
288-
getDriver().Diag(diag::err_drv_argument_not_allowed_with)
289-
<< "-fwasm-exceptions"
290-
<< "-mno-reference-types";
291285
// '-fwasm-exceptions' is not compatible with
292286
// '-mllvm -enable-emscripten-cxx-exceptions'
293287
for (const Arg *A : DriverArgs.filtered(options::OPT_mllvm)) {
@@ -296,11 +290,9 @@ void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs,
296290
<< "-fwasm-exceptions"
297291
<< "-mllvm -enable-emscripten-cxx-exceptions";
298292
}
299-
// '-fwasm-exceptions' implies exception-handling and reference-types
293+
// '-fwasm-exceptions' implies exception-handling feature
300294
CC1Args.push_back("-target-feature");
301295
CC1Args.push_back("+exception-handling");
302-
CC1Args.push_back("-target-feature");
303-
CC1Args.push_back("+reference-types");
304296
}
305297
}
306298

clang/test/Driver/wasm-toolchain.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,18 @@
7979
// RUN: | FileCheck -check-prefix=PTHREAD_NO_SIGN_EXT %s
8080
// PTHREAD_NO_SIGN_EXT: invalid argument '-pthread' not allowed with '-mno-sign-ext'
8181

82-
// '-fwasm-exceptions' sets +exception-handling and +reference-types
82+
// '-fwasm-exceptions' sets +exception-handling
8383
// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
8484
// RUN: --sysroot=/foo %s -fwasm-exceptions 2>&1 \
8585
// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS %s
86-
// WASM_EXCEPTIONS: clang{{.*}}" "-cc1" {{.*}} "-target-feature" "+exception-handling" "-target-feature" "+reference-types"
86+
// WASM_EXCEPTIONS: clang{{.*}}" "-cc1" {{.*}} "-target-feature" "+exception-handling"
8787

8888
// '-fwasm-exceptions' not allowed with '-mno-exception-handling'
8989
// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
9090
// RUN: --sysroot=/foo %s -fwasm-exceptions -mno-exception-handling 2>&1 \
9191
// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS_NO_EH %s
9292
// WASM_EXCEPTIONS_NO_EH: invalid argument '-fwasm-exceptions' not allowed with '-mno-exception-handling'
9393

94-
// '-fwasm-exceptions' not allowed with '-mno-reference-types'
95-
// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
96-
// RUN: --sysroot=/foo %s -fwasm-exceptions -mno-reference-types 2>&1 \
97-
// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS_NO_REFTYPES %s
98-
// WASM_EXCEPTIONS_NO_REFTYPES: invalid argument '-fwasm-exceptions' not allowed with '-mno-reference-types'
99-
10094
// '-fwasm-exceptions' not allowed with
10195
// '-mllvm -enable-emscripten-cxx-exceptions'
10296
// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \

0 commit comments

Comments
 (0)