Rephrase asm_mismatched_size_modifier diagnostic. <rdar://problem/14050339>
The text of this diagnostic was unnecessarily specific to the current ARM implementation of validateConstraintModifier, and it gave a potentially confusing suggestion for fixing the problem. The ARM-specific issue is not a big deal since that is the only target that currently does any checking of asm operand modifiers, but until my change in 183172 it was still wrong for output operands in the way that it referred to the value being truncated when put into a register, since output operands are retrieved from the registers instead of being put into them. The bigger problem is that its suggestion to "use a modifier" is wrong and confusing in the case where a "q" modifier is incorrectly used with an "r" constraint. In that case, the solution might well be to remove the modifier or perhaps change the constraint. It's better to just leave the diagnostic message more generic. llvm-svn: 183209
This commit is contained in:
parent
d943fc3429
commit
d91fff27ca
|
@ -5496,8 +5496,8 @@ let CategoryName = "Inline Assembly Issue" in {
|
|||
"accepted due to -fheinous-gnu-extensions, but clang may remove support "
|
||||
"for this in the future">;
|
||||
def warn_asm_mismatched_size_modifier : Warning<
|
||||
"the value is truncated when put into register, "
|
||||
"use a modifier to specify the size">,
|
||||
"value size does not match register size specified by the constraint "
|
||||
"and modifier">,
|
||||
InGroup<ASMOperandWidths>;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ typedef struct int64x2x4_t {
|
|||
int64x2x4_t t1(const long long a[]) {
|
||||
int64x2x4_t r;
|
||||
__asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
|
||||
: [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r3] "=r"(r.val[3]) // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
: [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r3] "=r"(r.val[3]) // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
: [a] "r"(a));
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ typedef struct int64x2x4_t {
|
|||
int64x2x4_t t2(const long long a[]) {
|
||||
int64x2x4_t r;
|
||||
__asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
|
||||
: [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
[r3] "=r"(r.val[3]) // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
|
||||
: [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
[r3] "=r"(r.val[3]) // expected-warning {{value size does not match register size specified by the constraint and modifier}}
|
||||
: [a] "r"(a));
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue