[WebAssembly] Improve clang diagnostics for wasm attributes
authorDan Gohman <sunfish@mozilla.com>
Fri, 5 Jun 2020 21:27:52 +0000 (14:27 -0700)
committerDan Gohman <sunfish@mozilla.com>
Fri, 5 Jun 2020 21:32:51 +0000 (14:32 -0700)
commit0d4e243456809eabd6914669753eda242b5da4cb
tree5d5bea7f52c8dbf90686555a7d78ef151e6f9854
parent8b05b6d53342b4532b046f85cbbe3278ed4d59cb
[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
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/AST/ast-dump-wasm-attr-export.c [new file with mode: 0644]
clang/test/AST/ast-dump-wasm-attr-import.c [new file with mode: 0644]
clang/test/Sema/attr-wasm.c [new file with mode: 0644]