[Inline-asm] Add diagnosts for unsupported inline assembly arguments
authorPhoebe Wang <phoebe.wang@intel.com>
Wed, 23 Mar 2022 03:24:54 +0000 (11:24 +0800)
committerPhoebe Wang <phoebe.wang@intel.com>
Wed, 23 Mar 2022 03:25:19 +0000 (11:25 +0800)
commit32103608fc073700f04238872d8b22655ddec3fb
tree54ce4d52713a8866cd0157140164624ef068352e
parentf4037650e0c74454e12b4eabd94fec06d678505f
[Inline-asm] Add diagnosts for unsupported inline assembly arguments

GCC supports power-of-2 size structures for the arguments. Clang supports fewer than GCC. But Clang always crashes for the unsupported cases.

This patch adds sema checks to do the diagnosts to solve these crashes.

Reviewed By: jyu2

Differential Revision: https://reviews.llvm.org/D107141
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/CodeGen/CGStmt.cpp
clang/lib/Sema/SemaStmtAsm.cpp
clang/test/Sema/asm.c