llvm.org GIT mirror llvm / a4020f2
On behalf of Matthew Wahab: An instruction alias defined with InstAlias and an optional operand in the middle of the AsmString field, "..${a} <operands>", would get the final "}" printed in the instruction disassembly. This wouldn't happen if the optional operand appeared as the last item in the AsmString which is how the current backends avoided the problem. There don't appear to be any tests for this part of Tablegen but it passes the pre-commit tests. Manually tested the change by enabling the generic alias printer in the ARM backend and checking the output. Differential Revision: http://reviews.llvm.org/D6529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224348 91177308-0d34-0410-b5e6-96231b3b80d8 Evgeny Astigeevich 4 years ago
1 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
654654 std::pair parseName(StringRef::iterator Start,
655655 StringRef::iterator End) {
656656 StringRef::iterator I = Start;
657 StringRef::iterator Next;
657658 if (*I == '{') {
658659 // ${some_name}
659660 Start = ++I;
660661 while (I != End && *I != '}')
661662 ++I;
663 Next = I;
664 // eat the final '}'
665 if (Next != End)
666 ++Next;
662667 } else {
663668 // $name, just eat the usual suspects.
664669 while (I != End &&
665670 ((*I >= 'a' && *I <= 'z') || (*I >= 'A' && *I <= 'Z') ||
666671 (*I >= '0' && *I <= '9') || *I == '_'))
667672 ++I;
668 }
669
670 return std::make_pair(StringRef(Start, I - Start), I);
673 Next = I;
674 }
675
676 return std::make_pair(StringRef(Start, I - Start), Next);
671677 }
672678
673679 void print(raw_ostream &O) {