Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance

the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2011-10-16 04:47:35 +00:00
parent 17730847d5
commit d8b7aa2613
20 changed files with 188 additions and 79 deletions

View File

@@ -337,13 +337,9 @@ int EDDisassembler::printInst(std::string &str, MCInst &inst) {
return 0;
}
static void diag_handler(const SMDiagnostic &diag,
void *context)
{
if (context) {
EDDisassembler *disassembler = static_cast<EDDisassembler*>(context);
diag.Print("", disassembler->ErrorStream);
}
static void diag_handler(const SMDiagnostic &diag, void *context) {
if (context)
diag.print("", static_cast<EDDisassembler*>(context)->ErrorStream);
}
int EDDisassembler::parseInst(SmallVectorImpl<MCParsedAsmOperand*> &operands,