diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-27 07:56:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-27 07:56:39 +0000 |
commit | 160f252aa8189beba57b0b025b0206a3910c4ae9 (patch) | |
tree | 859e0917bb45722fb82ae57fb7e892d30b29986f /tools | |
parent | f449eb343e70f1e4e8f982939d53c083a1bc5ba3 (diff) | |
download | external_llvm-160f252aa8189beba57b0b025b0206a3910c4ae9.zip external_llvm-160f252aa8189beba57b0b025b0206a3910c4ae9.tar.gz external_llvm-160f252aa8189beba57b0b025b0206a3910c4ae9.tar.bz2 |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index ec66797..f995a63 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -39,6 +39,9 @@ static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename")); +static cl::opt<bool> +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!"); |