diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-11-12 06:42:51 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-11-12 06:42:51 +0000 |
commit | 68fd608c2c0866064e974c3d43778c47c1cbb080 (patch) | |
tree | e2c7183de084260133fe95211e56ba2a548e1c9a /lib/Basic/Targets.cpp | |
parent | c6b82c353bef4cbc0d1dde8580abf8d0a266e64b (diff) |
Check that the input size is correct for the given constraint.
The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot
place a 64-bit value into the 32-bit register. Error out instead of causing the
compiler to spew general badness.
<rdar://problem/12415959>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 26a4f41442..ea4ac27a35 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -2595,6 +2595,19 @@ public: if (RegNo == 1) return 2; return -1; } + virtual bool validateInputSize(StringRef Constraint, + unsigned Size) const { + switch (Constraint[0]) { + default: break; + case 'a': + case 'b': + case 'c': + case 'd': + return Size == 32; + } + + return true; + } }; } // end anonymous namespace |