llvm.org GIT mirror llvm / cca89d3
[dsymutil] Split some logic into a helper function. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244085 91177308-0d34-0410-b5e6-96231b3b80d8 Frederic Riss 5 years ago
1 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
6767 init(false), cat(DsymCategory));
6868 }
6969
70 static std::string getOutputFileName(llvm::StringRef InputFile) {
71 if (OutputFileOpt.empty()) {
72 if (InputFile == "-")
73 return "a.out.dwarf";
74 return (InputFile + ".dwarf").str();
75 }
76 return OutputFileOpt;
77 }
78
7079 int main(int argc, char **argv) {
7180 llvm::sys::PrintStackTraceOnErrorSignal();
7281 llvm::PrettyStackTraceProgram StackPrinter(argc, argv);
119128 if (DumpDebugMap)
120129 continue;
121130
122 std::string OutputFile;
123 if (OutputFileOpt.empty()) {
124 if (InputFile == "-")
125 OutputFile = "a.out.dwarf";
126 else
127 OutputFile = InputFile + ".dwarf";
128 } else {
129 OutputFile = OutputFileOpt;
130 }
131
131 std::string OutputFile = getOutputFileName(InputFile);
132132 if (!linkDwarf(OutputFile, **DebugMapPtrOrErr, Options))
133133 return 1;
134134 }