mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Include a source location when complaining about bad inline assembly.
Add a MI->emitError() method that the backend can use to report errors related to inline assembly. Call it from X86FloatingPoint.cpp when the constraints are wrong. This enables proper clang diagnostics from the backend: $ clang -c pr30848.c pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack __asm__ ("" : "=u" (d)); /* { dg-error "output regs" } */ ^ 1 error generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "llvm/ADT/ilist.h"
|
||||
#include "llvm/ADT/ilist_node.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/DenseMapInfo.h"
|
||||
#include "llvm/Support/DebugLoc.h"
|
||||
#include <vector>
|
||||
@ -180,6 +181,15 @@ public:
|
||||
///
|
||||
DebugLoc getDebugLoc() const { return debugLoc; }
|
||||
|
||||
/// emitError - Emit an error referring to the source location of this
|
||||
/// instruction. This should only be used for inline assembly that is somehow
|
||||
/// impossible to compile. Other errors should have been handled much
|
||||
/// earlier.
|
||||
///
|
||||
/// If this method returns, the caller should try to recover from the error.
|
||||
///
|
||||
void emitError(StringRef Msg) const;
|
||||
|
||||
/// getDesc - Returns the target instruction descriptor of this
|
||||
/// MachineInstr.
|
||||
const MCInstrDesc &getDesc() const { return *MCID; }
|
||||
|
Reference in New Issue
Block a user