[ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,

rather than deriving the StringRef from the Start and End SMLocs.

Using the Start and End SMLocs works fine for operands such as [Symbol], but
not for operands such as [Symbol + ImmDisp].  All existing test cases that
reference a variable exercise this patch.
rdar://13602265



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier
2013-04-09 17:53:49 +00:00
parent 6fac1fbf30
commit b976e407dc
3 changed files with 47 additions and 38 deletions

View File

@@ -37,15 +37,7 @@ public:
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());
}
virtual StringRef getSymName() { return StringRef(); }
/// isToken - Is this a token operand?
virtual bool isToken() const = 0;