summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-05-18 22:48:41 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-05-18 22:48:41 +0000
commit30243c74c0ebf703410161faf7c6e9374119c00e (patch)
tree35bbd22c651571595dd32c66baf777d76f4d72de /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
parentbd5a09d3b2930669dcfff474445ca67f4888f9a9 (diff)
downloadbcm5719-llvm-30243c74c0ebf703410161faf7c6e9374119c00e.tar.gz
bcm5719-llvm-30243c74c0ebf703410161faf7c6e9374119c00e.zip
Some refactorings with respect to setting of the 'printTokenized' flag.
Add some comments. llvm-svn: 131594
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 2620eedac61..fc1de902865 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -200,35 +200,31 @@ InstructionLLVM::Dump
EDTokenRef token;
const char *tokenStr;
- if (EDGetToken(&token, m_inst, tokenIndex))
+ if (EDGetToken(&token, m_inst, tokenIndex)) // 0 on success
printTokenized = false;
-
- if (!printTokenized || !EDTokenIsOpcode(token))
+ else if (!EDTokenIsOpcode(token))
printTokenized = false;
-
- if (!printTokenized || EDGetTokenString(&tokenStr, token))
+ else if (EDGetTokenString(&tokenStr, token)) // 0 on success
printTokenized = false;
- // Put the token string into our opcode string
- opcode.PutCString(tokenStr);
-
- // If anything follows, it probably starts with some whitespace. Skip it.
-
- tokenIndex++;
-
- if (printTokenized && tokenIndex < numTokens)
+ if (printTokenized)
{
- if(!printTokenized || EDGetToken(&token, m_inst, tokenIndex))
- printTokenized = false;
+ // Put the token string into our opcode string
+ opcode.PutCString(tokenStr);
- if(!printTokenized || !EDTokenIsWhitespace(token))
- printTokenized = false;
- }
+ // If anything follows, it probably starts with some whitespace. Skip it.
+ if (++tokenIndex < numTokens)
+ {
+ if (EDGetToken(&token, m_inst, tokenIndex)) // 0 on success
+ printTokenized = false;
+ else if (!EDTokenIsWhitespace(token))
+ printTokenized = false;
+ }
- tokenIndex++;
+ ++tokenIndex;
+ }
// Handle the operands and the comment.
-
StreamString operands;
StreamString comment;
OpenPOWER on IntegriCloud