File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,14 @@ llvm::Error handleMappingPhaseErrors(llvm::Error Err,
260260 return Err;
261261}
262262
263+ llvm::Error ensureOutputDirExists (const std::string &OutDirectory) {
264+ // Ensure the root output directory exists.
265+ if (std::error_code Err = llvm::sys::fs::create_directories (OutDirectory)) {
266+ return llvm::createFileError (OutDirectory, Err);
267+ }
268+ return llvm::Error::success ();
269+ }
270+
263271int main (int argc, const char **argv) {
264272 llvm::sys::PrintStackTraceOnErrorSignal (argv[0 ]);
265273 std::error_code OK;
@@ -384,9 +392,7 @@ Example usage for a project using a compile commands database:
384392 sortUsrToInfo (USRToInfo);
385393
386394 // Ensure the root output directory exists.
387- if (std::error_code Err = llvm::sys::fs::create_directories (OutDirectory)) {
388- ExitOnErr (llvm::createFileError (OutDirectory, Err));
389- }
395+ ExitOnErr (ensureOutputDirExists (OutDirectory));
390396
391397 // Run the generator.
392398 llvm::outs () << " Generating docs...\n " ;
You can’t perform that action at this time.
0 commit comments