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 | c25e7581b9b8088910da31702d4ca21c4734c6d7 (patch) | |
tree | e4bb95c96a33fda5d5204f2c9d1b906084760415 /lib/VMCore/AsmWriter.cpp | |
parent | d51ffcf303070b0a5aea7f365b85f6f969c384cb (diff) | |
download | llvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.gz llvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.bz2 llvm-c25e7581b9b8088910da31702d4ca21c4734c6d7.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index face5a192a..959da81b0d 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -97,7 +97,7 @@ static void PrintLLVMName(raw_ostream &OS, const char *NameStr, unsigned NameLen, PrefixType Prefix) { assert(NameStr && "Cannot get empty name!"); switch (Prefix) { - default: assert(0 && "Bad prefix!"); + default: LLVM_UNREACHABLE("Bad prefix!"); case NoPrefix: break; case GlobalPrefix: OS << '@'; break; case LabelPrefix: break; @@ -937,7 +937,7 @@ static void WriteConstantInt(raw_ostream &Out, const Constant *CV, else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble) Out << 'M'; else - assert(0 && "Unsupported floating point type"); + LLVM_UNREACHABLE("Unsupported floating point type"); // api needed to prevent premature destruction APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t* p = api.getRawData(); @@ -1210,7 +1210,7 @@ public: else if (const Function *F = dyn_cast<Function>(G)) printFunction(F); else - assert(0 && "Unknown global"); + LLVM_UNREACHABLE("Unknown global"); } void write(const BasicBlock *BB) { printBasicBlock(BB); } @@ -1358,7 +1358,7 @@ static void PrintLinkage(GlobalValue::LinkageTypes LT, raw_ostream &Out) { static void PrintVisibility(GlobalValue::VisibilityTypes Vis, raw_ostream &Out) { switch (Vis) { - default: assert(0 && "Invalid visibility style!"); + default: LLVM_UNREACHABLE("Invalid visibility style!"); case GlobalValue::DefaultVisibility: break; case GlobalValue::HiddenVisibility: Out << "hidden "; break; case GlobalValue::ProtectedVisibility: Out << "protected "; break; @@ -1969,7 +1969,7 @@ void Value::print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const { } else if (isa<InlineAsm>(this)) { WriteAsOperand(OS, this, true, 0); } else { - assert(0 && "Unknown value to print out!"); + LLVM_UNREACHABLE("Unknown value to print out!"); } } |