Skip to content

Commit 7aaf024

Browse files
committed
[BitcodeWriter] Fix cases of some functions
`WriteIndexToFile` is used by external projects so I do not touch it.
1 parent 85dfe19 commit 7aaf024

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ void clang::EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
17461746
llvm::MemoryBufferRef Buf) {
17471747
if (CGOpts.getEmbedBitcode() == CodeGenOptions::Embed_Off)
17481748
return;
1749-
llvm::EmbedBitcodeInModule(
1749+
llvm::embedBitcodeInModule(
17501750
*M, Buf, CGOpts.getEmbedBitcode() != CodeGenOptions::Embed_Marker,
17511751
CGOpts.getEmbedBitcode() != CodeGenOptions::Embed_Bitcode,
17521752
CGOpts.CmdArgs);

lld/ELF/LTO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static void thinLTOCreateEmptyIndexFiles() {
292292

293293
ModuleSummaryIndex m(/*HaveGVs*/ false);
294294
m.setSkipModuleByDistributedBackend();
295-
WriteIndexToFile(m, *os);
295+
writeIndexToFile(m, *os);
296296
if (config->thinLTOEmitImportsFiles)
297297
openFile(path + ".imports");
298298
}

llvm/include/llvm/Bitcode/BitcodeWriter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class raw_ostream;
139139
///
140140
/// ModHash is for use in ThinLTO incremental build, generated while the IR
141141
/// bitcode file writing.
142-
void WriteThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
142+
void writeThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
143143
const ModuleSummaryIndex &Index,
144144
const ModuleHash &ModHash);
145145

@@ -148,7 +148,7 @@ class raw_ostream;
148148
/// writing the combined index file for ThinLTO. When writing a subset of the
149149
/// index for a distributed backend, provide the \p ModuleToSummariesForIndex
150150
/// map.
151-
void WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
151+
void writeIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
152152
const std::map<std::string, GVSummaryMapTy>
153153
*ModuleToSummariesForIndex = nullptr);
154154

@@ -161,7 +161,7 @@ class raw_ostream;
161161
/// If EmbedCmdline is set, the command line is also exported in
162162
/// the corresponding section (__LLVM,_cmdline / .llvmcmd) - even if CmdArgs
163163
/// were empty.
164-
void EmbedBitcodeInModule(Module &M, MemoryBufferRef Buf, bool EmbedBitcode,
164+
void embedBitcodeInModule(Module &M, MemoryBufferRef Buf, bool EmbedBitcode,
165165
bool EmbedCmdline,
166166
const std::vector<uint8_t> &CmdArgs);
167167

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4669,7 +4669,7 @@ void IndexBitcodeWriter::write() {
46694669
// where it will be written in a new bitcode block. This is used when
46704670
// writing the combined index file for ThinLTO. When writing a subset of the
46714671
// index for a distributed backend, provide a \p ModuleToSummariesForIndex map.
4672-
void llvm::WriteIndexToFile(
4672+
void llvm::writeIndexToFile(
46734673
const ModuleSummaryIndex &Index, raw_ostream &Out,
46744674
const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
46754675
SmallVector<char, 0> Buffer;
@@ -4829,7 +4829,7 @@ void BitcodeWriter::writeThinLinkBitcode(const Module &M,
48294829
// Write the specified thin link bitcode file to the given raw output stream,
48304830
// where it will be written in a new bitcode block. This is used when
48314831
// writing the per-module index file for ThinLTO.
4832-
void llvm::WriteThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
4832+
void llvm::writeThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
48334833
const ModuleSummaryIndex &Index,
48344834
const ModuleHash &ModHash) {
48354835
SmallVector<char, 0> Buffer;
@@ -4881,7 +4881,7 @@ static const char *getSectionNameForCommandline(const Triple &T) {
48814881
llvm_unreachable("Unimplemented ObjectFormatType");
48824882
}
48834883

4884-
void llvm::EmbedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
4884+
void llvm::embedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
48854885
bool EmbedBitcode, bool EmbedCmdline,
48864886
const std::vector<uint8_t> &CmdArgs) {
48874887
// Save llvm.compiler.used and remove it.

llvm/lib/LTO/LTO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ class WriteIndexesThinBackend : public ThinBackendProc {
13721372
sys::fs::OpenFlags::OF_None);
13731373
if (EC)
13741374
return errorCodeToError(EC);
1375-
WriteIndexToFile(CombinedIndex, OS, &ModuleToSummariesForIndex);
1375+
writeIndexToFile(CombinedIndex, OS, &ModuleToSummariesForIndex);
13761376

13771377
if (ShouldEmitImportsFiles) {
13781378
EC = EmitImportsFiles(ModulePath, NewModulePath + ".imports",

llvm/lib/LTO/LTOBackend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Error Config::addSaveTemps(std::string OutputFileName,
144144
// directly and exit.
145145
if (EC)
146146
reportOpenError(Path, EC.message());
147-
WriteIndexToFile(Index, OS);
147+
writeIndexToFile(Index, OS);
148148

149149
Path = OutputFileName + "index.dot";
150150
raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_None);
@@ -359,7 +359,7 @@ bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
359359
LLVM_DEBUG(
360360
dbgs() << "Post-(Thin)LTO merge bitcode embedding was requested, but "
361361
"command line arguments are not available");
362-
llvm::EmbedBitcodeInModule(Mod, llvm::MemoryBufferRef(),
362+
llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(),
363363
/*EmbedBitcode*/ true, /*EmbedCmdline*/ true,
364364
/*Cmdline*/ CmdArgs);
365365
}
@@ -380,7 +380,7 @@ static void codegen(const Config &Conf, TargetMachine *TM,
380380
return;
381381

382382
if (EmbedBitcode == LTOBitcodeEmbedding::EmbedOptimized)
383-
llvm::EmbedBitcodeInModule(Mod, llvm::MemoryBufferRef(),
383+
llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(),
384384
/*EmbedBitcode*/ true,
385385
/*EmbedCmdline*/ false,
386386
/*CmdArgs*/ std::vector<uint8_t>());

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ void ThinLTOCodeGenerator::run() {
10521052
if (EC)
10531053
report_fatal_error(Twine("Failed to open ") + SaveTempPath +
10541054
" to save optimized bitcode\n");
1055-
WriteIndexToFile(*Index, OS);
1055+
writeIndexToFile(*Index, OS);
10561056
}
10571057

10581058

llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void writeThinLTOBitcode(raw_ostream &OS, raw_ostream *ThinLinkOS,
535535
// the information that is needed by thin link will be written in the
536536
// given OS.
537537
if (ThinLinkOS && Index)
538-
WriteThinLinkBitcodeToFile(M, *ThinLinkOS, *Index, ModHash);
538+
writeThinLinkBitcodeToFile(M, *ThinLinkOS, *Index, ModHash);
539539
}
540540

541541
class WriteThinLTOBitcode : public ModulePass {

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ bool DevirtModule::runForTesting(
970970
if (StringRef(ClWriteSummary).endswith(".bc")) {
971971
raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::OF_None);
972972
ExitOnErr(errorCodeToError(EC));
973-
WriteIndexToFile(*Summary, OS);
973+
writeIndexToFile(*Summary, OS);
974974
} else {
975975
raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::OF_TextWithCRLF);
976976
ExitOnErr(errorCodeToError(EC));

llvm/tools/gold/gold-plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static void writeEmptyDistributedBuildOutputs(const std::string &ModulePath,
995995
if (SkipModule) {
996996
ModuleSummaryIndex Index(/*HaveGVs*/ false);
997997
Index.setSkipModuleByDistributedBackend();
998-
WriteIndexToFile(Index, OS, nullptr);
998+
writeIndexToFile(Index, OS, nullptr);
999999
}
10001000
}
10011001
if (options::thinlto_emit_imports_files) {

llvm/tools/llvm-as/llvm-as.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) {
106106
else
107107
// Otherwise, with an empty Module but non-empty Index, we write a
108108
// combined index.
109-
WriteIndexToFile(*IndexToWrite, Out->os());
109+
writeIndexToFile(*IndexToWrite, Out->os());
110110
}
111111

112112
// Declare success.

llvm/tools/llvm-lto/llvm-lto.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static void createCombinedModuleSummaryIndex() {
497497
raw_fd_ostream OS(OutputFilename + ".thinlto.bc", EC,
498498
sys::fs::OpenFlags::OF_None);
499499
error(EC, "error opening the file '" + OutputFilename + ".thinlto.bc'");
500-
WriteIndexToFile(CombinedIndex, OS);
500+
writeIndexToFile(CombinedIndex, OS);
501501
OS.close();
502502
}
503503

@@ -660,7 +660,7 @@ class ThinLTOProcessing {
660660
std::error_code EC;
661661
raw_fd_ostream OS(OutputFilename, EC, sys::fs::OpenFlags::OF_None);
662662
error(EC, "error opening the file '" + OutputFilename + "'");
663-
WriteIndexToFile(*CombinedIndex, OS);
663+
writeIndexToFile(*CombinedIndex, OS);
664664
}
665665

666666
/// Load the combined index from disk, then compute and generate
@@ -698,7 +698,7 @@ class ThinLTOProcessing {
698698
std::error_code EC;
699699
raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::OF_None);
700700
error(EC, "error opening the file '" + OutputName + "'");
701-
WriteIndexToFile(*Index, OS, &ModuleToSummariesForIndex);
701+
writeIndexToFile(*Index, OS, &ModuleToSummariesForIndex);
702702
}
703703
}
704704

0 commit comments

Comments
 (0)