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
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index d7d675a..6094976 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -17,6 +17,7 @@
#include "llvm/Function.h"
#include "llvm/GlobalVariable.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -151,7 +152,7 @@
ConstDataCoalSection:
MergeableConstSection(cast<GlobalVariable>(GV)));
default:
- assert(0 && "Unsuported section kind for global");
+ LLVM_UNREACHABLE("Unsuported section kind for global");
}
// FIXME: Do we have any extra special weird cases?
@@ -211,6 +212,6 @@
std::string
DarwinTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
SectionKind::Kind kind) const {
- assert(0 && "Darwin does not use unique sections");
+ LLVM_UNREACHABLE("Darwin does not use unique sections");
return "";
}