diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-11-13 10:37:14 -0800 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-11-13 10:38:57 -0800 |
| commit | 1ca85b3d33a14394c9c11d68a40d038075d7e8ee (patch) | |
| tree | d97bf45af252e9d96208045e60b30207d26c9303 /llvm | |
| parent | 7313d7d6188a0ea1cebe3aa5ec27d53f4ccc1286 (diff) | |
| download | bcm5719-llvm-1ca85b3d33a14394c9c11d68a40d038075d7e8ee.tar.gz bcm5719-llvm-1ca85b3d33a14394c9c11d68a40d038075d7e8ee.zip | |
[llvm-bcanalyzer] Don't dump the contents if -dump is not passed
With all the previous refactorings this slipped through and now we
always dump the contents of the bitcode files, even if -dump is not
passed.
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/Other/bcanalyzer-dump-option.txt | 11 | ||||
| -rw-r--r-- | llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/llvm/test/Other/bcanalyzer-dump-option.txt b/llvm/test/Other/bcanalyzer-dump-option.txt new file mode 100644 index 00000000000..1da2a033b6a --- /dev/null +++ b/llvm/test/Other/bcanalyzer-dump-option.txt @@ -0,0 +1,11 @@ +RUN: llvm-bcanalyzer -dump %S/Inputs/has-block-info.bc | FileCheck -check-prefix=WITH-DUMP %s +RUN: llvm-bcanalyzer %S/Inputs/has-block-info.bc | FileCheck -check-prefix=WITHOUT-DUMP %s + +WITH-DUMP: <ABC +WITHOUT-DUMP-NOT: <ABC +WITH-DUMP: </ABC> +WITHOUT-DUMP-NOT: </ABC> +WITH-DUMP: <XYZ +WITHOUT-DUMP-NOT: <XYZ +WITH-DUMP: </XYZ> +WITHOUT-DUMP-NOT: </XYZ> diff --git a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp index 01cba1f6e3c..639a6d1ec02 100644 --- a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -102,8 +102,9 @@ int main(int argc, char **argv) { O.Symbolic = !NonSymbolic; O.ShowBinaryBlobs = ShowBinaryBlobs; - ExitOnErr( - BA.analyze(O, CheckHash.empty() ? None : Optional<StringRef>(CheckHash))); + ExitOnErr(BA.analyze( + Dump ? Optional<BCDumpOptions>(O) : Optional<BCDumpOptions>(None), + CheckHash.empty() ? None : Optional<StringRef>(CheckHash))); if (Dump) outs() << "\n\n"; |

