[llvm-commits] [llvm] r165830 - /llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h
Chad Rosier
mcrosier at apple.com
Fri Oct 12 15:15:11 PDT 2012
Author: mcrosier
Date: Fri Oct 12 17:15:11 2012
New Revision: 165830
URL: http://llvm.org/viewvc/llvm-project?rev=165830&view=rev
Log:
[ms-inline asm] Add a few data members and member functions to the
MCParsedAsmOperand class in support of ms-style inline assembly.
Modified:
llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h
Modified: llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h?rev=165830&r1=165829&r2=165830&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h (original)
+++ llvm/trunk/include/llvm/MC/MCParser/MCParsedAsmOperand.h Fri Oct 12 17:15:11 2012
@@ -19,10 +19,34 @@
/// 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?
More information about the llvm-commits
mailing list