[WebAssembly] Improve clang diagnostics for wasm attributes
authorDan Gohman <sunfish@mozilla.com>
Sat, 21 Dec 2019 06:11:03 +0000 (22:11 -0800)
committerDan Gohman <sunfish@mozilla.com>
Fri, 5 Jun 2020 18:27:51 +0000 (11:27 -0700)
commit931fcd3ba011c27626a95e5e35b657763284882a
tree3ebbb7f023dc070e70d39ecf31c93498a13aeaf4
parentd1a6e4d2db493c0ce27ccba7f287acfeac1776a6
[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.

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]