diff options
| author | Torok Edwin <edwintorok@gmail.com> | 2009-07-11 20:10:48 +0000 |
|---|---|---|
| committer | Torok Edwin <edwintorok@gmail.com> | 2009-07-11 20:10:48 +0000 |
| commit | 56d065972602c45a4109617f32eb8605e5017c5e (patch) | |
| tree | b74a0d6b8aa7cbcafe15f8128196d5afc60cf732 /llvm/lib/CodeGen/ELFWriter.cpp | |
| parent | 3085b57bb8e47561fc290ea6bbbea92f08250a2d (diff) | |
| download | bcm5719-llvm-56d065972602c45a4109617f32eb8605e5017c5e.tar.gz bcm5719-llvm-56d065972602c45a4109617f32eb8605e5017c5e.zip | |
assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
Diffstat (limited to 'llvm/lib/CodeGen/ELFWriter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ELFWriter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp index ddc3670665d..13180175c2d 100644 --- a/llvm/lib/CodeGen/ELFWriter.cpp +++ b/llvm/lib/CodeGen/ELFWriter.cpp @@ -51,6 +51,7 @@ #include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" using namespace llvm; @@ -147,7 +148,7 @@ bool ELFWriter::doInitialization(Module &M) { unsigned ELFWriter::getGlobalELFVisibility(const GlobalValue *GV) { switch (GV->getVisibility()) { default: - assert(0 && "unknown visibility type"); + LLVM_UNREACHABLE("unknown visibility type"); case GlobalValue::DefaultVisibility: return ELFSym::STV_DEFAULT; case GlobalValue::HiddenVisibility: @@ -339,9 +340,9 @@ void ELFWriter::EmitGlobalConstant(const Constant *CV, ELFSection &GblS) { else if (CFP->getType() == Type::FloatTy) GblS.emitWord32(Val); else if (CFP->getType() == Type::X86_FP80Ty) { - assert(0 && "X86_FP80Ty global emission not implemented"); + LLVM_UNREACHABLE("X86_FP80Ty global emission not implemented"); } else if (CFP->getType() == Type::PPC_FP128Ty) - assert(0 && "PPC_FP128Ty global emission not implemented"); + LLVM_UNREACHABLE("PPC_FP128Ty global emission not implemented"); return; } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { if (Size == 4) @@ -349,7 +350,7 @@ void ELFWriter::EmitGlobalConstant(const Constant *CV, ELFSection &GblS) { else if (Size == 8) GblS.emitWord64(CI->getZExtValue()); else - assert(0 && "LargeInt global emission not implemented"); + LLVM_UNREACHABLE("LargeInt global emission not implemented"); return; } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(CV)) { const VectorType *PTy = CP->getType(); @@ -357,7 +358,7 @@ void ELFWriter::EmitGlobalConstant(const Constant *CV, ELFSection &GblS) { EmitGlobalConstant(CP->getOperand(I), GblS); return; } - assert(0 && "unknown global constant"); + LLVM_UNREACHABLE("unknown global constant"); } |

