@@ -1703,9 +1703,8 @@ static uint8_t getOsAbi(const Triple &t) {
17031703 }
17041704}
17051705
1706- namespace dtlto {
17071706// Check if an archive file is a thin archive.
1708- bool isThinArchive (Ctx &ctx, StringRef archiveFilePath) {
1707+ static bool isThinArchive (Ctx &ctx, StringRef archiveFilePath) {
17091708 const size_t thinArchiveMagicLen = sizeof (ThinArchiveMagic) - 1 ;
17101709
17111710 ErrorOr<std::unique_ptr<MemoryBuffer>> memBufferOrError =
@@ -1720,8 +1719,9 @@ bool isThinArchive(Ctx &ctx, StringRef archiveFilePath) {
17201719}
17211720
17221721// Compute a thin archive member full file path.
1723- std::string computeFullThinArchiveMemberPath (const StringRef modulePath,
1724- const StringRef archiveName) {
1722+ static std::string
1723+ computeThinArchiveMemberFullPath (const StringRef modulePath,
1724+ const StringRef archiveName) {
17251725 assert (!archiveName.empty ());
17261726 SmallString<64 > archiveMemberPath;
17271727 if (path::is_relative (modulePath)) {
@@ -1733,7 +1733,6 @@ std::string computeFullThinArchiveMemberPath(const StringRef modulePath,
17331733 path::remove_dots (archiveMemberPath, /* remove_dot_dot=*/ true );
17341734 return archiveMemberPath.c_str ();
17351735}
1736- } // namespace dtlto
17371736
17381737BitcodeFile::BitcodeFile (Ctx &ctx, MemoryBufferRef mb, StringRef archiveName,
17391738 uint64_t offsetInArchive, bool lazy)
@@ -1746,11 +1745,11 @@ BitcodeFile::BitcodeFile(Ctx &ctx, MemoryBufferRef mb, StringRef archiveName,
17461745 path = replaceThinLTOSuffix (ctx, mb.getBufferIdentifier ());
17471746
17481747 // For DTLTO the name needs to be a valid path to a bitcode file.
1749- bool dtltoThinArchiveHandling = !ctx.arg .DTLTODistributor .empty () &&
1748+ bool dtltoThinArchiveHandling = !ctx.arg .dtltoDistributor .empty () &&
17501749 !archiveName.empty () &&
1751- dtlto:: isThinArchive (ctx, archiveName);
1750+ isThinArchive (ctx, archiveName);
17521751 if (dtltoThinArchiveHandling)
1753- path = dtlto::computeFullThinArchiveMemberPath (path, archiveName);
1752+ path = computeThinArchiveMemberFullPath (path, archiveName);
17541753
17551754 // ThinLTO assumes that all MemoryBufferRefs given to it have a unique
17561755 // name. If two archives define two members with the same name, this
0 commit comments