mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-02 10:33:53 +00:00
[ms-inline asm] Add a few data members and member functions to the
MCParsedAsmOperand class in support of ms-style inline assembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f3ad95a80b
commit
0d218994f1
@ -19,10 +19,34 @@ class raw_ostream;
|
||||
/// base class is used by target-independent clients and is the interface
|
||||
/// between parsing an asm instruction and recognizing it.
|
||||
class MCParsedAsmOperand {
|
||||
/// MCOperandNum - The corresponding MCInst operand number. Only valid when
|
||||
/// parsing MS-style inline assembly.
|
||||
unsigned MCOperandNum;
|
||||
|
||||
/// Constraint - The constraint on this operand. Only valid when parsing
|
||||
/// MS-style inline assembly.
|
||||
std::string Constraint;
|
||||
|
||||
public:
|
||||
MCParsedAsmOperand() {}
|
||||
virtual ~MCParsedAsmOperand() {}
|
||||
|
||||
void setConstraint(StringRef C) { Constraint = C.str(); }
|
||||
StringRef getConstraint() { return Constraint; }
|
||||
|
||||
void setMCOperandNum (unsigned OpNum) { MCOperandNum = OpNum; }
|
||||
unsigned getMCOperandNum() { return MCOperandNum; }
|
||||
|
||||
unsigned getNameLen() {
|
||||
assert (getStartLoc().isValid() && "Invalid StartLoc!");
|
||||
assert (getEndLoc().isValid() && "Invalid EndLoc!");
|
||||
return getEndLoc().getPointer() - getStartLoc().getPointer();
|
||||
}
|
||||
|
||||
StringRef getName() {
|
||||
return StringRef(getStartLoc().getPointer(), getNameLen());
|
||||
}
|
||||
|
||||
/// isToken - Is this a token operand?
|
||||
virtual bool isToken() const = 0;
|
||||
/// isImm - Is this an immediate operand?
|
||||
|
Loading…
x
Reference in New Issue
Block a user