I now have such an externalDefMap.txt file:
18:c:@F@BZ2_blockSort blocksort.c.ast
9:c:@F@main bzip2.c.ast
16:c:@F@BZ2_bzdopen bzlib.c.ast
19:c:@F@BZ2_indexIntoF bzlib.c.ast
20:c:@F@BZ2_bzWriteOpen bzlib.c.ast
15:c:@F@BZ2_bzRead bzlib.c.ast
23:c:@F@BZ2_bzWriteClose64 bzlib.c.ast
19:c:@F@BZ2_bzCompress bzlib.c.ast
24:c:@F@BZ2_bzDecompressEnd bzlib.c.ast
19:c:@F@BZ2_bzReadOpen bzlib.c.ast
24:c:@F@BZ2_bzReadGetUnused bzlib.c.ast
16:c:@F@BZ2_bzwrite bzlib.c.ast
15:c:@F@BZ2_bzopen bzlib.c.ast
26:c:@F@BZ2_bz__AssertH__fail bzlib.c.ast
21:c:@F@BZ2_bzDecompress bzlib.c.ast
29:c:@F@BZ2_bzBuffToBuffCompress bzlib.c.ast
16:c:@F@BZ2_bzclose bzlib.c.ast
20:c:@F@BZ2_bzReadClose bzlib.c.ast
15:c:@F@BZ2_bzread bzlib.c.ast
21:c:@F@BZ2_bzlibVersion bzlib.c.ast
31:c:@F@BZ2_bzBuffToBuffDecompress bzlib.c.ast
23:c:@F@BZ2_bzCompressInit bzlib.c.ast
21:c:@F@BZ2_bzWriteClose bzlib.c.ast
16:c:@F@BZ2_bzflush bzlib.c.ast
22:c:@F@BZ2_bzCompressEnd bzlib.c.ast
25:c:@F@BZ2_bzDecompressInit bzlib.c.ast
16:c:@F@BZ2_bzerror bzlib.c.ast
16:c:@F@BZ2_bzWrite bzlib.c.ast
20:c:@F@BZ2_bsInitWrite compress.c.ast
22:c:@F@BZ2_compressBlock compress.c.ast
19:c:@F@BZ2_decompress decompress.c.ast
26:c:@F@BZ2_hbMakeCodeLengths huffman.c.ast
22:c:@F@BZ2_hbAssignCodes huffman.c.ast
29:c:@F@BZ2_hbCreateDecodeTables huffman.c.ast
14:c:@F@load_file fpcmp.c.ast
30:c:@F@diff_files_with_tolerance fpcmp.c.ast
10:c:@F@usage fpcmp.c.ast
9:c:@F@main fpcmp.c.ast
Due to duplicate lookupname: 15:c:@ F@BZ2_bzRead bzlib. c.ast
So the code below will directly return:
bool InsertionOccured;
std::tie(std::ignore, InsertionOccured) =
Result.try_emplace(LookupName, FilePath.begin(), FilePath.end());
if (!InsertionOccured)
return llvm::make_error<IndexError>(
index_error_code::multiple_definitions, IndexPath.str(), LineNo);
I don’t think this should make mistakes.
It is a function in which different files in a project reference the same file.
It is reasonable.
There are also two files that define a function with the same name at the same time, which will cause the problem of duplicate lookupname.
I hope someone can answer my doubts, thank you