From 3c6591d6ea4611b8ca0c3fc09a3554c2ae42a72c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 30 Nov 2012 23:18:12 +0000 Subject: Don't warn if the input size is less than the register size. Also don't warn if the output size is greater than the register size. No truncation occurs with those. Reword warning to make it clearer what's the problem is. llvm-svn: 169054 --- clang/lib/Basic/Targets.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Basic') diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index d6312d6e5dc..3c076ca4f03 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -3364,6 +3364,8 @@ public: virtual bool validateConstraintModifier(StringRef Constraint, const char Modifier, unsigned Size) const { + bool isOutput = (Constraint[0] == '='); + // Strip off constraint modifiers. while (Constraint[0] == '=' || Constraint[0] == '+' || @@ -3375,7 +3377,7 @@ public: case 'r': { switch (Modifier) { default: - return Size == 32; + return (isOutput && Size >= 32) || Size <= 32; case 'q': // A register of size 32 cannot fit a vector type. return false; -- cgit v1.2.3