Skip to content

Commit 76316ec

Browse files
[Legacy ThinLTO] NFC: Use explicit static; shrink anonymous namespace
Improve compliance with https://llvm.org/docs/CodingStandards.html#anonymous-namespaces: > [Only] use [anonymous namespaces] for class declarations.
1 parent 8aa69a0 commit 76316ec

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ extern cl::opt<std::optional<uint64_t>, false, remarks::HotnessThresholdParser>
8585
extern cl::opt<std::string> RemarksFormat;
8686
}
8787

88-
namespace {
89-
9088
// Default to using all available threads in the system, but using only one
9189
// thred per core, as indicated by the usage of
9290
// heavyweight_hardware_concurrency() below.
@@ -326,8 +324,8 @@ computeGUIDPreservedSymbols(const lto::InputFile &File,
326324
return GUIDPreservedSymbols;
327325
}
328326

329-
std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule,
330-
TargetMachine &TM) {
327+
static std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule,
328+
TargetMachine &TM) {
331329
SmallVector<char, 128> OutputBuffer;
332330

333331
// CodeGen
@@ -347,6 +345,7 @@ std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule,
347345
std::move(OutputBuffer), /*RequiresNullTerminator=*/false);
348346
}
349347

348+
namespace {
350349
/// Manage caching for a single Module.
351350
class ModuleCacheEntry {
352351
SmallString<128> EntryPath;
@@ -424,6 +423,7 @@ class ModuleCacheEntry {
424423
toString(std::move(Err)).c_str()));
425424
}
426425
};
426+
} // end anonymous namespace
427427

428428
static std::unique_ptr<MemoryBuffer>
429429
ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index,
@@ -541,8 +541,6 @@ static void initTMBuilder(TargetMachineBuilder &TMBuilder,
541541
TMBuilder.TheTriple = std::move(TheTriple);
542542
}
543543

544-
} // end anonymous namespace
545-
546544
void ThinLTOCodeGenerator::addModule(StringRef Identifier, StringRef Data) {
547545
MemoryBufferRef Buffer(Data, Identifier);
548546

0 commit comments

Comments
 (0)