From b44fd24fc107e62155aa39d33ebbee45f05639c7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 29 Sep 2010 01:42:58 +0000 Subject: change the protocol TargetAsmPArser::MatchInstruction method to take an MCStreamer to emit into instead of an MCInst to fill in. This allows the matcher extra flexibility and is more convenient. llvm-svn: 115014 --- llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp') diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 62712fc5be5..6eb564bc562 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -80,16 +80,18 @@ private: bool ParseDirectiveSyntax(SMLoc L); - bool MatchInstruction(SMLoc IDLoc, + bool MatchAndEmitInstruction(SMLoc IDLoc, const SmallVectorImpl &Operands, - MCInst &Inst) { + MCStreamer &Out) { + MCInst Inst; unsigned ErrorInfo; - if (MatchInstructionImpl(Operands, Inst, ErrorInfo) == Match_Success) + if (MatchInstructionImpl(Operands, Inst, ErrorInfo) == Match_Success) { + Out.EmitInstruction(Inst); return false; + } // FIXME: We should give nicer diagnostics about the exact failure. Error(IDLoc, "unrecognized instruction"); - return true; } -- cgit v1.2.3