forked from OSchip/llvm-project
MCAsmParser: Add dump() hook to MCParsedAsmOperand.
llvm-svn: 110790
This commit is contained in:
parent
69f024b855
commit
ebace2248f
|
@ -12,6 +12,7 @@
|
|||
|
||||
namespace llvm {
|
||||
class SMLoc;
|
||||
class raw_ostream;
|
||||
|
||||
/// MCParsedAsmOperand - This abstract class represents a source-level assembly
|
||||
/// instruction operand. It should be subclassed by target-specific code. This
|
||||
|
@ -23,9 +24,12 @@ public:
|
|||
virtual ~MCParsedAsmOperand() {}
|
||||
|
||||
/// getStartLoc - Get the location of the first token of this operand.
|
||||
virtual SMLoc getStartLoc() const;
|
||||
virtual SMLoc getStartLoc() const = 0;
|
||||
/// getEndLoc - Get the location of the last token of this operand.
|
||||
virtual SMLoc getEndLoc() const;
|
||||
virtual SMLoc getEndLoc() const = 0;
|
||||
|
||||
/// dump - Print a debug representation of the operand to the given stream.
|
||||
virtual void dump(raw_ostream &OS) const = 0;
|
||||
};
|
||||
|
||||
} // end namespace llvm.
|
||||
|
|
|
@ -41,8 +41,4 @@ bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
|
|||
return ParseExpression(Res, L);
|
||||
}
|
||||
|
||||
/// getStartLoc - Get the location of the first token of this operand.
|
||||
SMLoc MCParsedAsmOperand::getStartLoc() const { return SMLoc(); }
|
||||
SMLoc MCParsedAsmOperand::getEndLoc() const { return SMLoc(); }
|
||||
|
||||
|
||||
|
|
|
@ -234,6 +234,8 @@ public:
|
|||
addExpr(Inst, getImm());
|
||||
}
|
||||
|
||||
virtual void dump(raw_ostream &OS) const {}
|
||||
|
||||
static void CreateToken(OwningPtr<ARMOperand> &Op, StringRef Str,
|
||||
SMLoc S) {
|
||||
Op.reset(new ARMOperand);
|
||||
|
|
|
@ -148,6 +148,8 @@ struct X86Operand : public MCParsedAsmOperand {
|
|||
/// getEndLoc - Get the location of the last token of this operand.
|
||||
SMLoc getEndLoc() const { return EndLoc; }
|
||||
|
||||
virtual void dump(raw_ostream &OS) const {}
|
||||
|
||||
StringRef getToken() const {
|
||||
assert(Kind == Token && "Invalid access!");
|
||||
return StringRef(Tok.Data, Tok.Length);
|
||||
|
|
Loading…
Reference in New Issue