@@ -247,8 +247,7 @@ sortUsrToInfo(llvm::StringMap<std::unique_ptr<doc::Info>> &USRToInfo) {
247247 }
248248}
249249
250- llvm::Error handleMappingPhaseErrors (llvm::Error Err,
251- bool IgnoreMappingFailures) {
250+ static llvm::Error handleMappingFailures (llvm::Error Err) {
252251 if (!Err)
253252 return llvm::Error::success ();
254253 if (IgnoreMappingFailures) {
@@ -260,10 +259,9 @@ llvm::Error handleMappingPhaseErrors(llvm::Error Err,
260259 return Err;
261260}
262261
263- llvm::Error ensureOutputDirExists ( const std::string & OutDirectory) {
264- if (std::error_code Err = llvm::sys::fs::create_directories (OutDirectory)) {
262+ static llvm::Error createDirectories (llvm::StringRef OutDirectory) {
263+ if (std::error_code Err = llvm::sys::fs::create_directories (OutDirectory))
265264 return llvm::createFileError (OutDirectory, Err);
266- }
267265 return llvm::Error::success ();
268266}
269267
@@ -321,9 +319,8 @@ Example usage for a project using a compile commands database:
321319
322320 // Mapping phase
323321 llvm::outs () << " Mapping decls...\n " ;
324- ExitOnErr (handleMappingPhaseErrors (
325- Executor->execute (doc::newMapperActionFactory (CDCtx), ArgAdjuster),
326- IgnoreMappingFailures));
322+ ExitOnErr (handleMappingFailures (
323+ Executor->execute (doc::newMapperActionFactory (CDCtx), ArgAdjuster)));
327324
328325 // Collect values into output by key.
329326 // In ToolResults, the Key is the hashed USR and the value is the
@@ -391,7 +388,7 @@ Example usage for a project using a compile commands database:
391388 sortUsrToInfo (USRToInfo);
392389
393390 // Ensure the root output directory exists.
394- ExitOnErr (ensureOutputDirExists (OutDirectory));
391+ ExitOnErr (createDirectories (OutDirectory));
395392
396393 // Run the generator.
397394 llvm::outs () << " Generating docs...\n " ;
0 commit comments