From 7f42f72a50cf6b5e108f10c94e0c2e529a50497b Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Thu, 8 Apr 2010 00:48:21 +0000 Subject: Added support for ARM disassembly to edis. I also added a rule to the ARM target's Makefile to build the ARM-specific instruction information table for the enhanced disassembler. I will add the test harness for all this stuff in a separate commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100735 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/edis/EDToken.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools/edis/EDToken.cpp') diff --git a/tools/edis/EDToken.cpp b/tools/edis/EDToken.cpp index cd79152..3bcb0a1 100644 --- a/tools/edis/EDToken.cpp +++ b/tools/edis/EDToken.cpp @@ -68,20 +68,20 @@ int EDToken::operandID() const { } int EDToken::literalSign() const { - if(Type != kTokenLiteral) + if (Type != kTokenLiteral) return -1; return (LiteralSign ? 1 : 0); } int EDToken::literalAbsoluteValue(uint64_t &value) const { - if(Type != kTokenLiteral) + if (Type != kTokenLiteral) return -1; value = LiteralAbsoluteValue; return 0; } int EDToken::registerID(unsigned ®isterID) const { - if(Type != kTokenRegister) + if (Type != kTokenRegister) return -1; registerID = RegisterID; return 0; @@ -94,7 +94,7 @@ int EDToken::tokenize(std::vector &tokens, SmallVector parsedOperands; SmallVector asmTokens; - if(disassembler.parseInst(parsedOperands, asmTokens, str)) + if (disassembler.parseInst(parsedOperands, asmTokens, str)) return -1; SmallVectorImpl::iterator operandIterator; @@ -115,7 +115,7 @@ int EDToken::tokenize(std::vector &tokens, const char *tokenPointer = tokenLoc.getPointer(); - if(tokenPointer > wsPointer) { + if (tokenPointer > wsPointer) { unsigned long wsLength = tokenPointer - wsPointer; EDToken *whitespaceToken = new EDToken(StringRef(wsPointer, wsLength), @@ -164,7 +164,7 @@ int EDToken::tokenize(std::vector &tokens, int64_t intVal = tokenIterator->getIntVal(); - if(intVal < 0) + if (intVal < 0) token->makeLiteral(true, -intVal); else token->makeLiteral(false, intVal); @@ -182,14 +182,14 @@ int EDToken::tokenize(std::vector &tokens, } } - if(operandIterator != parsedOperands.end() && + if (operandIterator != parsedOperands.end() && tokenLoc.getPointer() >= (*operandIterator)->getStartLoc().getPointer()) { /// operandIndex == 0 means the operand is the instruction (which the /// AsmParser treats as an operand but edis does not). We therefore skip /// operandIndex == 0 and subtract 1 from all other operand indices. - if(operandIndex > 0) + if (operandIndex > 0) token->setOperandID(operandOrder[operandIndex - 1]); } @@ -200,7 +200,7 @@ int EDToken::tokenize(std::vector &tokens, } int EDToken::getString(const char*& buf) { - if(PermStr.length() == 0) { + if (PermStr.length() == 0) { PermStr = Str.str(); } buf = PermStr.c_str(); -- cgit v1.1