mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +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;
|
bool readOpcode = false;
|
||||||
|
|
||||||
|
const char *wsPointer = asmTokens.begin()->getLoc().getPointer();
|
||||||
|
|
||||||
for (tokenIterator = asmTokens.begin();
|
for (tokenIterator = asmTokens.begin();
|
||||||
tokenIterator != asmTokens.end();
|
tokenIterator != asmTokens.end();
|
||||||
++tokenIterator) {
|
++tokenIterator) {
|
||||||
SMLoc tokenLoc = tokenIterator->getLoc();
|
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() &&
|
while (operandIterator != parsedOperands.end() &&
|
||||||
tokenLoc.getPointer() >
|
tokenLoc.getPointer() >
|
||||||
(*operandIterator)->getEndLoc().getPointer()) {
|
(*operandIterator)->getEndLoc().getPointer()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user