]> granicus.if.org Git - clang/commit
[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)
commit6110e25f386f83065b79d44c3152161462d08d4f
tree90d86037cf21306e2b0442f81089fece6012ab1d
parent18f6b6749529b838cce3d2f8bd04abdc84487ec4
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228089 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaStmtAsm.cpp
test/Sema/inline-asm-validate-aarch64.c