@@ -243,11 +243,19 @@ void Annotator::registerInterestingDefinition(clang::SourceRange sourceRange,
243
243
244
244
bool Annotator::generate (clang::Sema &Sema, bool WasInDatabase)
245
245
{
246
+ #if CLANG_VERSION_MAJOR >= 16
247
+ static const std::string mp_suffix =
248
+ llvm::sys::Process::GetEnv (" MULTIPROCESS_MODE" ).value_or (" " );
249
+ #else
250
+ static const std::string mp_suffix =
251
+ llvm::sys::Process::GetEnv (" MULTIPROCESS_MODE" ).getValueOr (" " );
252
+ #endif
253
+
246
254
std::ofstream fileIndex;
247
- fileIndex.open (projectManager.outputPrefix + " /fileIndex" , std::ios::app);
255
+ fileIndex.open (projectManager.outputPrefix + " /fileIndex" + mp_suffix , std::ios::app);
248
256
if (!fileIndex) {
249
257
create_directories (projectManager.outputPrefix );
250
- fileIndex.open (projectManager.outputPrefix + " /fileIndex" , std::ios::app);
258
+ fileIndex.open (projectManager.outputPrefix + " /fileIndex" + mp_suffix , std::ios::app);
251
259
if (!fileIndex) {
252
260
std::cerr << " Can't generate index for " << std::endl;
253
261
return false ;
@@ -257,14 +265,6 @@ bool Annotator::generate(clang::Sema &Sema, bool WasInDatabase)
257
265
// make sure the main file is in the cache.
258
266
htmlNameForFile (getSourceMgr ().getMainFileID ());
259
267
260
- #if CLANG_VERSION_MAJOR >= 16
261
- static const std::string mp_suffix =
262
- llvm::sys::Process::GetEnv (" MULTIPROCESS_MODE" ).value_or (" " );
263
- #else
264
- static const std::string mp_suffix =
265
- llvm::sys::Process::GetEnv (" MULTIPROCESS_MODE" ).getValueOr (" " );
266
- #endif
267
-
268
268
std::set<std::string> done;
269
269
for (auto it : cache) {
270
270
if (!it.second .first )
0 commit comments