================
@@ -501,15 +502,26 @@ Error JSONGenerator::generateDocs(
 
     SmallString<128> Path;
     sys::path::native(RootDir, Path);
-    sys::path::append(Path, Info->getRelativeFilePath(""));
     if (!CreatedDirs.contains(Path)) {
       if (std::error_code Err = sys::fs::create_directories(Path);
           Err != std::error_code())
         return createFileError(Twine(Path), Err);
       CreatedDirs.insert(Path);
     }
 
-    sys::path::append(Path, Info->getFileBaseName() + ".json");
+    SmallString<16> FileName;
+    if (Info->IT == InfoType::IT_record) {
----------------
ilovepi wrote:

Maybe this would be nicer as a helper function?  I'm not convinced either way, 
since its only used once, but I'd consider abstracting out that much logic into 
something like  `StringRef generateFileName(Info*)`.

https://github.com/llvm/llvm-project/pull/148021
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to