diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-12 20:16:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-12 20:16:58 +0000 |
commit | c53544af06acf3fba1788613a364f1f40317869e (patch) | |
tree | f3b4b91dfd702a43f14330bf5526513804656b9a /lib/Target | |
parent | ee92637cfa4c7b3f85bd526e888923f87ab045b0 (diff) | |
download | external_llvm-c53544af06acf3fba1788613a364f1f40317869e.zip external_llvm-c53544af06acf3fba1788613a364f1f40317869e.tar.gz external_llvm-c53544af06acf3fba1788613a364f1f40317869e.tar.bz2 |
Make error messages more useful than jsut an abort
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 11 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelSimple.cpp | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index 4a24741..e2e91f7 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -1543,6 +1543,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, BMI(BB, IP, X86::MOVrr32, 1, DestReg).addReg(SrcReg); BMI(BB, IP, X86::MOVrr32, 1, DestReg+1).addReg(SrcReg+1); } else { + assert(0 && "Cannot handle this type of cast instruction!"); abort(); } return; @@ -1593,8 +1594,10 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, if (DestClass == cFP) { // unsigned int -> load as 64 bit int. // unsigned long long -> more complex - if (SrcTy->isUnsigned() && SrcTy != Type::UByteTy) + if (SrcTy->isUnsigned() && SrcTy != Type::UByteTy) { + assert(0 && "Cannot handle this type of cast!"); abort(); // don't handle unsigned src yet! + } // We don't have the facilities for directly loading byte sized data from // memory. Promote it to 16 bits. @@ -1612,7 +1615,10 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, F->getFrameInfo()->CreateStackObject(SrcTy, TM.getTargetData()); if (SrcClass == cLong) { - if (SrcTy == Type::ULongTy) abort(); // FIXME: Handle ulong -> FP + if (SrcTy == Type::ULongTy) { + assert(0 && "FIXME: Handle cast ulong to FP"); + abort(); + } addFrameReference(BMI(BB, IP, X86::MOVrm32, 5), FrameIdx).addReg(SrcReg); addFrameReference(BMI(BB, IP, X86::MOVrm32, 5), FrameIdx, 4).addReg(SrcReg+1); @@ -1685,6 +1691,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, } // Anything we haven't handled already, we can't (yet) handle at all. + assert(0 && "Unhandled cast instruction!"); abort(); } diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index 4a24741..e2e91f7 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -1543,6 +1543,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, BMI(BB, IP, X86::MOVrr32, 1, DestReg).addReg(SrcReg); BMI(BB, IP, X86::MOVrr32, 1, DestReg+1).addReg(SrcReg+1); } else { + assert(0 && "Cannot handle this type of cast instruction!"); abort(); } return; @@ -1593,8 +1594,10 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, if (DestClass == cFP) { // unsigned int -> load as 64 bit int. // unsigned long long -> more complex - if (SrcTy->isUnsigned() && SrcTy != Type::UByteTy) + if (SrcTy->isUnsigned() && SrcTy != Type::UByteTy) { + assert(0 && "Cannot handle this type of cast!"); abort(); // don't handle unsigned src yet! + } // We don't have the facilities for directly loading byte sized data from // memory. Promote it to 16 bits. @@ -1612,7 +1615,10 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, F->getFrameInfo()->CreateStackObject(SrcTy, TM.getTargetData()); if (SrcClass == cLong) { - if (SrcTy == Type::ULongTy) abort(); // FIXME: Handle ulong -> FP + if (SrcTy == Type::ULongTy) { + assert(0 && "FIXME: Handle cast ulong to FP"); + abort(); + } addFrameReference(BMI(BB, IP, X86::MOVrm32, 5), FrameIdx).addReg(SrcReg); addFrameReference(BMI(BB, IP, X86::MOVrm32, 5), FrameIdx, 4).addReg(SrcReg+1); @@ -1685,6 +1691,7 @@ void ISel::emitCastOperation(MachineBasicBlock *BB, } // Anything we haven't handled already, we can't (yet) handle at all. + assert(0 && "Unhandled cast instruction!"); abort(); } |