You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[WebAssembly] Improve clang diagnostics for wasm attributes
This patch addresses the review comments on r352930:
- Removes redundant diagnostic checking code
- Removes errnoneous use of diag::err_alias_is_definition, which
turned out to be ineffective anyway since functions can be defined later
in the translation unit and avoid detection.
- Adds a test for various invalid cases for import_name and import_module.
This reapplies D59520, with the addition of adding
`InGroup<IgnoredAttributes>` to the new warnings, to fix the
Misc/warning-flags.c failure.
Differential Revision: https://reviews.llvm.org/D59520
voidname_a() __attribute__((import_name)); //expected-error {{'import_name' attribute takes one argument}}
4
+
5
+
intname_b __attribute__((import_name("foo"))); //expected-error {{'import_name' attribute only applies to functions}}
6
+
7
+
voidname_c() __attribute__((import_name("foo", "bar"))); //expected-error {{'import_name' attribute takes one argument}}
8
+
9
+
voidname_d() __attribute__((import_name("foo", "bar", "qux"))); //expected-error {{'import_name' attribute takes one argument}}
10
+
11
+
voidname_z() __attribute__((import_name("foo"))); //expected-note {{previous attribute is here}}
12
+
13
+
voidname_z() __attribute__((import_name("bar"))); //expected-warning {{import name (bar) does not match the import name (foo) of the previous declaration}}
14
+
15
+
voidmodule_a() __attribute__((import_module)); //expected-error {{'import_module' attribute takes one argument}}
16
+
17
+
intmodule_b __attribute__((import_module("foo"))); //expected-error {{'import_module' attribute only applies to functions}}
18
+
19
+
voidmodule_c() __attribute__((import_module("foo", "bar"))); //expected-error {{'import_module' attribute takes one argument}}
20
+
21
+
voidmodule_d() __attribute__((import_module("foo", "bar", "qux"))); //expected-error {{'import_module' attribute takes one argument}}
22
+
23
+
voidmodule_z() __attribute__((import_module("foo"))); //expected-note {{previous attribute is here}}
24
+
25
+
voidmodule_z() __attribute__((import_module("bar"))); //expected-warning {{import module (bar) does not match the import module (foo) of the previous declaration}}
0 commit comments