]> granicus.if.org Git - clang/commit
[AArch64, inline-asm] Improve diagnostic that is printed when the size of a
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 22 Aug 2014 06:05:21 +0000 (06:05 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 22 Aug 2014 06:05:21 +0000 (06:05 +0000)
commitdfc0ac7f3dc3f309bdc48135622d02d9c2efbd56
treedef4c97ba78c6d5c1dee89b7a1087f7fda027084
parent7276d2da27ae7cfd5bfc6326c0f90cf1b391d43d
[AArch64, inline-asm] Improve diagnostic that is printed when the size of a
variable that has regiser constraint "r" is not 64-bit.

General register operands are output using 64-bit "x" register names, regardless
of the size of the variable, unless the asm operand is prefixed with the "%w"
modifier. This surprises and confuses many users who aren't familiar with
aarch64 inline assembly rules.

With this commit, a note and fixit hint are printed which tell the users that
they need modifier "%w" in order to output a "w" register instead of an "x"
register.

<rdar://problem/12764785>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216260 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Stmt.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/TargetInfo.h
lib/AST/Stmt.cpp
lib/Basic/Targets.cpp
lib/Sema/SemaStmtAsm.cpp
test/Sema/arm64-inline-asm.c
test/Sema/inline-asm-validate-aarch64.c [new file with mode: 0644]
test/Sema/inline-asm-validate.c