summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2013-06-04 06:10:09 +0000
committerBob Wilson <bob.wilson@apple.com>2013-06-04 06:10:09 +0000
commitd91fff27ca6f84cdd6048e3b1c10f26901aa4a95 (patch)
tree748564c287bb1bee5ebd678fb4487b3eab8e0bbc /clang
parentd943fc342950924fbccce0cac1c90cd6f615517c (diff)
downloadbcm5719-llvm-d91fff27ca6f84cdd6048e3b1c10f26901aa4a95.tar.gz
bcm5719-llvm-d91fff27ca6f84cdd6048e3b1c10f26901aa4a95.zip
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
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td4
-rw-r--r--clang/test/CodeGen/arm-asm-diag.c8
-rw-r--r--clang/test/CodeGen/arm-asm-warn.c8
3 files changed, 10 insertions, 10 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index d49457b1a5c..a97e1cc3555 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -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>;
}
diff --git a/clang/test/CodeGen/arm-asm-diag.c b/clang/test/CodeGen/arm-asm-diag.c
index eea7920b106..bbf916d4633 100644
--- a/clang/test/CodeGen/arm-asm-diag.c
+++ b/clang/test/CodeGen/arm-asm-diag.c
@@ -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;
}
diff --git a/clang/test/CodeGen/arm-asm-warn.c b/clang/test/CodeGen/arm-asm-warn.c
index dbcbb38a749..6112b19d28c 100644
--- a/clang/test/CodeGen/arm-asm-warn.c
+++ b/clang/test/CodeGen/arm-asm-warn.c
@@ -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;
}
OpenPOWER on IntegriCloud