mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Specified ReportError as noreturn friendly to old compilers.
llvm-svn: 305405
This commit is contained in:
parent
c49b4d60a1
commit
47799b1106
@ -514,6 +514,20 @@ static uint64_t readPointer(const DataExtractor &Data, uint32_t &Offset,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a workaround for old compilers which do not allow
|
||||||
|
// noreturn attribute usage in lambdas. Once the support for those
|
||||||
|
// compilers are phased out, we can remove this and return back to
|
||||||
|
// a ReportError lambda: [StartOffset](const char *ErrorMsg).
|
||||||
|
#define ReportError(ErrorMsg) ReportErrorImpl(StartOffset,ErrorMsg)
|
||||||
|
static void LLVM_ATTRIBUTE_NORETURN
|
||||||
|
ReportErrorImpl(uint32_t StartOffset, const char *ErrorMsg) {
|
||||||
|
std::string Str;
|
||||||
|
raw_string_ostream OS(Str);
|
||||||
|
OS << format(ErrorMsg, StartOffset);
|
||||||
|
OS.flush();
|
||||||
|
report_fatal_error(Str);
|
||||||
|
}
|
||||||
|
|
||||||
void DWARFDebugFrame::parse(DataExtractor Data) {
|
void DWARFDebugFrame::parse(DataExtractor Data) {
|
||||||
uint32_t Offset = 0;
|
uint32_t Offset = 0;
|
||||||
DenseMap<uint32_t, CIE *> CIEs;
|
DenseMap<uint32_t, CIE *> CIEs;
|
||||||
@ -521,14 +535,6 @@ void DWARFDebugFrame::parse(DataExtractor Data) {
|
|||||||
while (Data.isValidOffset(Offset)) {
|
while (Data.isValidOffset(Offset)) {
|
||||||
uint32_t StartOffset = Offset;
|
uint32_t StartOffset = Offset;
|
||||||
|
|
||||||
auto ReportError = [StartOffset](const char *ErrorMsg) {
|
|
||||||
std::string Str;
|
|
||||||
raw_string_ostream OS(Str);
|
|
||||||
OS << format(ErrorMsg, StartOffset);
|
|
||||||
OS.flush();
|
|
||||||
report_fatal_error(Str);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool IsDWARF64 = false;
|
bool IsDWARF64 = false;
|
||||||
uint64_t Length = Data.getU32(&Offset);
|
uint64_t Length = Data.getU32(&Offset);
|
||||||
uint64_t Id;
|
uint64_t Id;
|
||||||
@ -585,7 +591,6 @@ void DWARFDebugFrame::parse(DataExtractor Data) {
|
|||||||
switch (AugmentationString[i]) {
|
switch (AugmentationString[i]) {
|
||||||
default:
|
default:
|
||||||
ReportError("Unknown augmentation character in entry at %lx");
|
ReportError("Unknown augmentation character in entry at %lx");
|
||||||
llvm_unreachable("ReportError should not return.");
|
|
||||||
case 'L':
|
case 'L':
|
||||||
LSDAPointerEncoding = Data.getU8(&Offset);
|
LSDAPointerEncoding = Data.getU8(&Offset);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user