mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 05:35:11 +00:00
Switch the LLVM error reporting on the new diagnostic system.
The LLVM diagnostic are now wired-up in clang (since r200931), thus the user experience will not be impacted by this change anymore. Related to <rdar://problem/15886697> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8048c44580
commit
341149ae85
@ -115,17 +115,12 @@ void *LLVMContext::getDiagnosticContext() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LLVMContext::emitError(const Twine &ErrorStr) {
|
void LLVMContext::emitError(const Twine &ErrorStr) {
|
||||||
emitError(0U, ErrorStr);
|
diagnose(DiagnosticInfoInlineAsm(ErrorStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
|
void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
|
||||||
unsigned LocCookie = 0;
|
assert (I && "Invalid instruction");
|
||||||
if (const MDNode *SrcLoc = I->getMetadata("srcloc")) {
|
diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr));
|
||||||
if (SrcLoc->getNumOperands() != 0)
|
|
||||||
if (const ConstantInt *CI = dyn_cast<ConstantInt>(SrcLoc->getOperand(0)))
|
|
||||||
LocCookie = CI->getZExtValue();
|
|
||||||
}
|
|
||||||
return emitError(LocCookie, ErrorStr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLVMContext::diagnose(const DiagnosticInfo &DI) {
|
void LLVMContext::diagnose(const DiagnosticInfo &DI) {
|
||||||
@ -154,16 +149,7 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
|
void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
|
||||||
// If there is no error handler installed, just print the error and exit.
|
diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
|
||||||
if (pImpl->InlineAsmDiagHandler == 0) {
|
|
||||||
errs() << "error: " << ErrorStr << "\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we do have an error handler, we can report the error and keep going.
|
|
||||||
SMDiagnostic Diag("", SourceMgr::DK_Error, ErrorStr.str());
|
|
||||||
|
|
||||||
pImpl->InlineAsmDiagHandler(Diag, pImpl->InlineAsmDiagContext, LocCookie);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
Reference in New Issue
Block a user