[inlineasm] Fix an incorrect warning about register constraint and modifier.
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 4 Feb 2015 00:27:13 +0000 (00:27 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 4 Feb 2015 00:27:13 +0000 (00:27 +0000)
commit96a36017f769c759f226a4b710d6e4f907ea0ef0
tree40f0dd4cea708a9ca25605a85200f1bc70f93223
parentbc18d6ab055f45948c8f7d37fa545959f9514ca0
[inlineasm] Fix an incorrect warning about register constraint and modifier.

Previously, when the following piece of code was compiled, clang would
incorrectly warn that the size of "wide_two" does not match register size
specified by the constraint and modifier":

long wide_two = two;
asm ("%w0 %1" : "+r" (one), "+r"(wide_two));

This was caused by a miscalculation of ConstraintIdx in Sema::ActOnGCCAsmStmt.

This commit fixes PR21270 and rdar://problem/18668354.

llvm-svn: 228089
clang/lib/Sema/SemaStmtAsm.cpp
clang/test/Sema/inline-asm-validate-aarch64.c