mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-29 14:40:39 +00:00
Updated the enhanced disassembly library to produce
whitespace tokens in the right places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3c3be582d
commit
2d58147ca5
@ -106,11 +106,28 @@ int EDToken::tokenize(std::vector<EDToken*> &tokens,
|
||||
|
||||
bool readOpcode = false;
|
||||
|
||||
const char *wsPointer = asmTokens.begin()->getLoc().getPointer();
|
||||
|
||||
for (tokenIterator = asmTokens.begin();
|
||||
tokenIterator != asmTokens.end();
|
||||
++tokenIterator) {
|
||||
SMLoc tokenLoc = tokenIterator->getLoc();
|
||||
|
||||
const char *tokenPointer = tokenLoc.getPointer();
|
||||
|
||||
if(tokenPointer > wsPointer) {
|
||||
unsigned long wsLength = tokenPointer - wsPointer;
|
||||
|
||||
EDToken *whitespaceToken = new EDToken(StringRef(wsPointer, wsLength),
|
||||
EDToken::kTokenWhitespace,
|
||||
0,
|
||||
disassembler);
|
||||
|
||||
tokens.push_back(whitespaceToken);
|
||||
}
|
||||
|
||||
wsPointer = tokenPointer + tokenIterator->getString().size();
|
||||
|
||||
while (operandIterator != parsedOperands.end() &&
|
||||
tokenLoc.getPointer() >
|
||||
(*operandIterator)->getEndLoc().getPointer()) {
|
||||
|
Loading…
Reference in New Issue
Block a user