summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-06-18 01:07:23 +0000
committerDale Johannesen <dalej@apple.com>2009-06-18 01:07:23 +0000
commit9d9acb065a06ec7d43cadf758d2fa17c74f433a6 (patch)
tree4c94f087b7066039c00fdce1bec569ccf04a0faf /llvm/lib/Target/CBackend/CBackend.cpp
parent89a303caac9d70d1b7fb05d8a33a3766e6f8cf5e (diff)
downloadbcm5719-llvm-9d9acb065a06ec7d43cadf758d2fa17c74f433a6.tar.gz
bcm5719-llvm-9d9acb065a06ec7d43cadf758d2fa17c74f433a6.zip
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. llvm-svn: 73668
Diffstat (limited to 'llvm/lib/Target/CBackend/CBackend.cpp')
-rw-r--r--llvm/lib/Target/CBackend/CBackend.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/CBackend/CBackend.cpp b/llvm/lib/Target/CBackend/CBackend.cpp
index 7b5ab6effec..c3554f6b573 100644
--- a/llvm/lib/Target/CBackend/CBackend.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud