diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-20 07:17:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-20 07:17:49 +0000 |
commit | 44790345377a7cf5a9eb50c382596c9649165896 (patch) | |
tree | 8966809e6ecb7634cc123ce958c3d59d095f4e4b /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 78f908c877fb9e6a563842e752ec2c64ae2ac401 (diff) | |
download | bcm5719-llvm-44790345377a7cf5a9eb50c382596c9649165896.tar.gz bcm5719-llvm-44790345377a7cf5a9eb50c382596c9649165896.zip |
Add an intel syntax MCInstPrinter implementation. You can now
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"
llvm-svn: 82385
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index fad1dd1685e..329efe92329 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -44,6 +44,10 @@ OutputFilename("o", cl::desc("Output filename"), static cl::opt<bool> ShowEncoding("show-encoding", cl::desc("Show instruction encodings")); +static cl::opt<unsigned> +OutputAsmVariant("output-asm-variant", + cl::desc("Syntax variant to use for output printing")); + enum OutputFileType { OFT_AssemblyFile, OFT_ObjectFile @@ -252,9 +256,7 @@ static int AssembleInput(const char *ProgName) { assert(MAI && "Unable to create target asm info!"); if (FileType == OFT_AssemblyFile) { - // FIXME: Syntax Variant should be selectable somehow? - unsigned SyntaxVariant = 0; - IP.reset(TheTarget->createMCInstPrinter(SyntaxVariant, *MAI, *Out)); + IP.reset(TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *Out)); if (ShowEncoding) CE.reset(TheTarget->createCodeEmitter(*TM)); Str.reset(createAsmStreamer(Ctx, *Out, *MAI, IP.get(), CE.get())); |