diff options
author | Sean Callanan <scallanan@apple.com> | 2010-04-09 01:43:16 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-04-09 01:43:16 +0000 |
commit | 8c0a1608d582b5cd277d3a55fb92324e48386bc9 (patch) | |
tree | ea903b00ee13f1e68eaeb182d2de1d15183bd1dc /tools/llvm-mc/llvm-mc.cpp | |
parent | be02b20a8f9e9503733df945968e48562714dd32 (diff) | |
download | external_llvm-8c0a1608d582b5cd277d3a55fb92324e48386bc9.zip external_llvm-8c0a1608d582b5cd277d3a55fb92324e48386bc9.tar.gz external_llvm-8c0a1608d582b5cd277d3a55fb92324e48386bc9.tar.bz2 |
Added a tester for the enhanced disassembler,
integrated into the llvm-mc testing tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index c6657f5..47f67c5 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -97,7 +97,8 @@ NoInitialTextSection("n", cl::desc( enum ActionType { AC_AsLex, AC_Assemble, - AC_Disassemble + AC_Disassemble, + AC_EDisassemble }; static cl::opt<ActionType> @@ -109,6 +110,8 @@ Action(cl::desc("Action to perform:"), "Assemble a .s file (default)"), clEnumValN(AC_Disassemble, "disassemble", "Disassemble strings of hex bytes"), + clEnumValN(AC_EDisassemble, "edis", + "Enhanced disassembly of strings of hex bytes"), clEnumValEnd)); static const Target *GetTarget(const char *ProgName) { @@ -325,7 +328,7 @@ static int AssembleInput(const char *ProgName) { return Res; } -static int DisassembleInput(const char *ProgName) { +static int DisassembleInput(const char *ProgName, bool Enhanced) { const Target *TheTarget = GetTarget(ProgName); if (!TheTarget) return 0; @@ -344,7 +347,10 @@ static int DisassembleInput(const char *ProgName) { return 1; } - return Disassembler::disassemble(*TheTarget, TripleName, *Buffer); + if (Enhanced) + return Disassembler::disassembleEnhanced(TripleName, *Buffer); + else + return Disassembler::disassemble(*TheTarget, TripleName, *Buffer); } @@ -371,7 +377,9 @@ int main(int argc, char **argv) { case AC_Assemble: return AssembleInput(argv[0]); case AC_Disassemble: - return DisassembleInput(argv[0]); + return DisassembleInput(argv[0], false); + case AC_EDisassemble: + return DisassembleInput(argv[0], true); } return 0; |