From: Daniel Dunbar Date: Thu, 27 Aug 2009 07:56:39 +0000 (+0000) Subject: llvm-mc: Only show instruction encodings with --show-encoding. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f2f6b0c0e9088da25a0367c88263ef8e7637a82c;p=oota-llvm.git llvm-mc: Only show instruction encodings with --show-encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80230 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index ec66797abcd..f995a63d8ee 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -39,6 +39,9 @@ static cl::opt OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename")); +static cl::opt +ShowEncoding("show-encoding", cl::desc("Show instruction encodings")); + enum OutputFileType { OFT_AssemblyFile, OFT_ObjectFile @@ -244,7 +247,8 @@ static int AssembleInput(const char *ProgName) { assert(TAI && "Unable to create target asm info!"); AP.reset(TheTarget->createAsmPrinter(*Out, *TM, TAI, true)); - CE.reset(TheTarget->createCodeEmitter(*TM)); + if (ShowEncoding) + CE.reset(TheTarget->createCodeEmitter(*TM)); Str.reset(createAsmStreamer(Ctx, *Out, *TAI, AP.get(), CE.get())); } else { assert(FileType == OFT_ObjectFile && "Invalid file type!");