diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-07-09 10:52:46 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-07-09 11:00:37 -0700 |
commit | 5dbcc7e0c9c12f4a4042fb4a226654aee927999c (patch) | |
tree | b316a3370e9286cb4e6f81b2f9d8bd8b54ce5123 /tools/llvm-dis/llvm-dis.cpp | |
parent | 86dc97be9ac3b4804528e087b04b4f4192cdee54 (diff) |
LOCALMODs from hg 0b098ca44de7 against r158408 (hg 90a87d6bfe45)
(only non-new files; new files in git 4f429c8b)
Change-Id: Ia39f818088485bd90e4d048db404f8d6ba5f836b
Diffstat (limited to 'tools/llvm-dis/llvm-dis.cpp')
-rw-r--r-- | tools/llvm-dis/llvm-dis.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index 6450ea6ac7..a5f68a6418 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/tools/llvm-dis/llvm-dis.cpp @@ -51,6 +51,13 @@ static cl::opt<bool> ShowAnnotations("show-annotations", cl::desc("Add informational comments to the .ll file")); +// @LOCALMOD-BEGIN +// Print bitcode metadata only, in text format. +// (includes output format, soname, and dependencies). +static cl::opt<bool> +DumpMetadata("dump-metadata", cl::desc("Dump bitcode metadata")); +// @LOCALMOD-END + namespace { static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) { @@ -156,7 +163,7 @@ int main(int argc, char **argv) { OutputFilename = "-"; if (OutputFilename.empty()) { // Unspecified output, infer it. - if (InputFilename == "-") { + if (InputFilename == "-" || DumpMetadata) { // @LOCALMOD OutputFilename = "-"; } else { const std::string &IFN = InputFilename; @@ -178,6 +185,14 @@ int main(int argc, char **argv) { return 1; } + // @LOCALMOD-BEGIN + if (DumpMetadata) { + M->dumpMeta(Out->os()); + Out->keep(); + return 0; + } + // @LOCALMOD-END + OwningPtr<AssemblyAnnotationWriter> Annotator; if (ShowAnnotations) Annotator.reset(new CommentWriter()); |