diff options
author | Dale Johannesen <dalej@apple.com> | 2009-06-18 01:07:23 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-06-18 01:07:23 +0000 |
commit | 063989455d9ce10e61e2c617394d403218b3ec03 (patch) | |
tree | d88c4910e21f65833f868eac25db40152c86c0d4 /lib/Target/CBackend | |
parent | 9e7d9883b0fbbce54f19936d3d4c870b17b5a758 (diff) | |
download | external_llvm-063989455d9ce10e61e2c617394d403218b3ec03.zip external_llvm-063989455d9ce10e61e2c617394d403218b3ec03.tar.gz external_llvm-063989455d9ce10e61e2c617394d403218b3ec03.tar.bz2 |
It looks like nobody is working on PR 4158, so I'm
adding a check to catch this case at compile time
instead of quietly generating incorrect code.
That will at least let us identify CBE failures
that are not due to this problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 7b5ab6e..c3554f6 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1454,6 +1454,17 @@ std::string CWriter::GetValueName(const Value *Operand) { /// writeInstComputationInline - Emit the computation for the specified /// instruction inline, with no destination provided. void CWriter::writeInstComputationInline(Instruction &I) { + // We can't currently support integer types other than 1, 8, 16, 32, 64. + // Validate this. + const Type *Ty = I.getType(); + if (Ty->isInteger() && (Ty!=Type::Int1Ty && Ty!=Type::Int8Ty && + Ty!=Type::Int16Ty && Ty!=Type::Int32Ty && Ty!=Type::Int64Ty)) { + cerr << "The C backend does not currently support integer " + << "types of widths other than 1, 8, 16, 32, 64.\n"; + cerr << "This is being tracked as PR 4158.\n"; + abort(); + } + // If this is a non-trivial bool computation, make sure to truncate down to // a 1 bit value. This is important because we want "add i1 x, y" to return // "0" when x and y are true, not "2" for example. |