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
This commit is contained in:
Torok Edwin
2009-07-11 20:10:48 +00:00
parent d51ffcf303
commit c25e7581b9
153 changed files with 695 additions and 610 deletions

View File

@@ -22,6 +22,7 @@
#include "llvm/Pass.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/SmallVector.h"
#include <string>
@@ -111,9 +112,8 @@ public:
/// @note This has to exist, because this is a pass, but it should never be
/// used.
TargetData() : ImmutablePass(&ID) {
assert(0 && "ERROR: Bad TargetData ctor used. "
"Tool did not specify a TargetData to use?");
abort();
llvm_report_error("ERROR: Bad TargetData ctor used. "
"Tool did not specify a TargetData to use?");
}
/// Constructs a TargetData from a specification string. See init().

View File

@@ -14,6 +14,7 @@
#ifndef LLVM_TARGET_TARGETINSTRINFO_H
#define LLVM_TARGET_TARGETINSTRINFO_H
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetInstrDesc.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -428,8 +429,7 @@ public:
/// point.
virtual void insertNoop(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const {
assert(0 && "Target didn't implement insertNoop!");
abort();
LLVM_UNREACHABLE("Target didn't implement insertNoop!");
}
/// isPredicated - Returns true if the instruction is already predicated.