[llvm-commits] [llvm] r95645 - /llvm/trunk/tools/edis/EDToken.cpp
Sean Callanan
scallanan at apple.com
Mon Feb 8 17:50:54 PST 2010
Author: spyffe
Date: Mon Feb 8 19:50:54 2010
New Revision: 95645
URL: http://llvm.org/viewvc/llvm-project?rev=95645&view=rev
Log:
Updated the enhanced disassembly library to produce
whitespace tokens in the right places.
Modified:
llvm/trunk/tools/edis/EDToken.cpp
Modified: llvm/trunk/tools/edis/EDToken.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/edis/EDToken.cpp?rev=95645&r1=95644&r2=95645&view=diff
==============================================================================
--- llvm/trunk/tools/edis/EDToken.cpp (original)
+++ llvm/trunk/tools/edis/EDToken.cpp Mon Feb 8 19:50:54 2010
@@ -106,11 +106,28 @@
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()) {
More information about the llvm-commits
mailing list