[PATCH] D33296: [llvm-pdbdump] in yaml2pdb, generate default output filename if none given
Bob Haarman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 14:00:08 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL303299: [llvm-pdbdump] in yaml2pdb, generate default output filename if none given (authored by inglorion).
Changed prior to commit:
https://reviews.llvm.org/D33296?vs=99340&id=99347#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33296
Files:
llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
Index: llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -117,6 +117,7 @@
}
Error PDBFileBuilder::commit(StringRef Filename) {
+ assert(!Filename.empty());
auto ExpectedLayout = finalizeMsfLayout();
if (!ExpectedLayout)
return ExpectedLayout.takeError();
Index: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
===================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -67,6 +67,7 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Regex.h"
@@ -365,9 +366,9 @@
YamlPdbOutputFile("pdb", cl::desc("the name of the PDB file to write"),
cl::sub(YamlToPdbSubcommand));
-cl::list<std::string> InputFilename(cl::Positional,
- cl::desc("<input YAML file>"), cl::Required,
- cl::sub(YamlToPdbSubcommand));
+cl::opt<std::string> InputFilename(cl::Positional,
+ cl::desc("<input YAML file>"), cl::Required,
+ cl::sub(YamlToPdbSubcommand));
}
namespace pdb2yaml {
@@ -894,7 +895,12 @@
if (opts::PdbToYamlSubcommand) {
pdb2Yaml(opts::pdb2yaml::InputFilename.front());
} else if (opts::YamlToPdbSubcommand) {
- yamlToPdb(opts::yaml2pdb::InputFilename.front());
+ if (opts::yaml2pdb::YamlPdbOutputFile.empty()) {
+ SmallString<16> OutputFilename(opts::yaml2pdb::InputFilename.getValue());
+ sys::path::replace_extension(OutputFilename, ".pdb");
+ opts::yaml2pdb::YamlPdbOutputFile = OutputFilename.str();
+ }
+ yamlToPdb(opts::yaml2pdb::InputFilename);
} else if (opts::AnalyzeSubcommand) {
dumpAnalysis(opts::analyze::InputFilename.front());
} else if (opts::PrettySubcommand) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33296.99347.patch
Type: text/x-patch
Size: 2211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/4b7cb6fd/attachment.bin>
More information about the llvm-commits
mailing list