mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 02:42:58 +00:00
[LLC] Add an inline assembly diagnostics handler.
Summary: llc would hit a fatal error for errors in inline assembly. The diagnostics message is now printed. Reviewers: rengolin, MatzeB, javed.absar, anemet Reviewed By: anemet Subscribers: jyknight, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D29408 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293999 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e96f3c3a4c
commit
5f9d8e2229
@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -29,4 +29,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -28,4 +28,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -12,4 +12,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -15,4 +15,4 @@
|
|||||||
|
|
||||||
module asm " .this_directive_is_very_unlikely_to_exist"
|
module asm " .this_directive_is_very_unlikely_to_exist"
|
||||||
|
|
||||||
; CHECK: LLVM ERROR: Error parsing inline asm
|
; CHECK: error: unknown directive
|
||||||
|
@ -253,6 +253,15 @@ static void DiagnosticHandler(const DiagnosticInfo &DI, void *Context) {
|
|||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void InlineAsmDiagHandler(const SMDiagnostic &SMD, void *Context,
|
||||||
|
unsigned) {
|
||||||
|
bool *HasError = static_cast<bool *>(Context);
|
||||||
|
if (SMD.getKind() == SourceMgr::DK_Error)
|
||||||
|
*HasError = true;
|
||||||
|
|
||||||
|
SMD.print(nullptr, errs());
|
||||||
|
}
|
||||||
|
|
||||||
// main - Entry point for the llc compiler.
|
// main - Entry point for the llc compiler.
|
||||||
//
|
//
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@ -294,6 +303,8 @@ int main(int argc, char **argv) {
|
|||||||
// Set a diagnostic handler that doesn't exit on the first error
|
// Set a diagnostic handler that doesn't exit on the first error
|
||||||
bool HasError = false;
|
bool HasError = false;
|
||||||
Context.setDiagnosticHandler(DiagnosticHandler, &HasError);
|
Context.setDiagnosticHandler(DiagnosticHandler, &HasError);
|
||||||
|
Context.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, &HasError);
|
||||||
|
|
||||||
if (PassRemarksWithHotness)
|
if (PassRemarksWithHotness)
|
||||||
Context.setDiagnosticHotnessRequested(true);
|
Context.setDiagnosticHotnessRequested(true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user