From 27476ce24b988b463029ef63d30f5c081d38923e Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 13 Sep 2017 09:43:05 +0000 Subject: [dwarfdump] Rename Brief to Verbose in DIDumpOptions This patches renames "brief" to "verbose" in de DIDumpOptions and inverts the logic to match the new behavior where brief is the default. Changing the default value uncovered some bugs related to the DIDumpOptions not being propagated and have been fixed as well. Differential revision: https://reviews.llvm.org/D37745 llvm-svn: 313139 --- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp') diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index 9fded20eeb5..39d207b8d58 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -82,6 +82,14 @@ static void error(StringRef Filename, std::error_code EC) { exit(1); } +static DIDumpOptions GetDumpOpts() { + DIDumpOptions DumpOpts; + DumpOpts.DumpType = DumpType; + DumpOpts.SummarizeTypes = SummarizeTypes; + DumpOpts.Verbose = Verbose; + return DumpOpts; +} + static void DumpObjectFile(ObjectFile &Obj, Twine Filename) { std::unique_ptr DICtx = DWARFContext::create(Obj); logAllUnhandledErrors(DICtx->loadRegisterInfo(Obj), errs(), @@ -92,11 +100,7 @@ static void DumpObjectFile(ObjectFile &Obj, Twine Filename) { // Dump the complete DWARF structure. - DIDumpOptions DumpOpts; - DumpOpts.DumpType = DumpType; - DumpOpts.SummarizeTypes = SummarizeTypes; - DumpOpts.Brief = !Verbose; - DICtx->dump(outs(), DumpOpts); + DICtx->dump(outs(), GetDumpOpts()); } static void DumpInput(StringRef Filename) { @@ -129,7 +133,7 @@ static bool VerifyObjectFile(ObjectFile &Obj, Twine Filename) { raw_ostream &stream = Quiet ? nulls() : outs(); stream << "Verifying " << Filename.str() << ":\tfile format " << Obj.getFileFormatName() << "\n"; - bool Result = DICtx->verify(stream, DumpType); + bool Result = DICtx->verify(stream, DumpType, GetDumpOpts()); if (Result) stream << "No errors.\n"; else -- cgit v1.2.3