Skip to content

Commit ee4ec95

Browse files
committed
[DTLTO][ELF][COFF][MachO] Add archive support for DTLTO - Fixed formating errors.
1 parent 9afd973 commit ee4ec95

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

lld/COFF/LTO.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ BitcodeCompiler::BitcodeCompiler(COFFLinkerContext &c) : ctx(c) {
132132
llvm::heavyweight_hardware_concurrency(ctx.config.thinLTOJobs));
133133
}
134134

135+
if (!ctx.config.dtltoDistributor.empty())
136+
ltoObj->Dtlto = true;
137+
135138
ltoObj = std::make_unique<lto::LTO>(createConfig(), backend,
136139
ctx.config.ltoPartitions);
137140
}

lld/ELF/LTO.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ BitcodeCompiler::BitcodeCompiler(Ctx &ctx) : ctx(ctx) {
202202
ctx.arg.ltoPartitions,
203203
ltoModes[ctx.arg.ltoKind]);
204204

205-
if(!ctx.arg.dtltoDistributor.empty())
206-
ltoObj->Dtlto = true;
205+
if (!ctx.arg.dtltoDistributor.empty())
206+
ltoObj->Dtlto = true;
207207

208208
// Initialize usedStartStop.
209209
if (ctx.bitcodeFiles.empty())

llvm/include/llvm/DTLTO/Dtlto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
namespace dtlto {
1616

17-
llvm::Expected<llvm::lto::InputFile*> addInput(llvm::lto::LTO *LtoObj,
18-
std::unique_ptr<llvm::lto::InputFile> Input);
17+
llvm::Expected<llvm::lto::InputFile *>
18+
addInput(llvm::lto::LTO *LtoObj, std::unique_ptr<llvm::lto::InputFile> Input);
1919

2020
llvm::Error process(llvm::lto::LTO &LtoObj);
2121
} // namespace dtlto

llvm/include/llvm/LTO/LTO.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,12 @@ class InputFile {
227227
bool isThinLTO() const { return IsThinLTO; }
228228

229229
// Store an archive path and a member name.
230-
void setArchivePathAndName(StringRef Path, StringRef Name) { ArchivePath = Path; MemberName = Name; }
231-
StringRef getArchivePath() const { return ArchivePath; }
232-
StringRef getMemberName() const { return MemberName; }
230+
void setArchivePathAndName(StringRef Path, StringRef Name) {
231+
ArchivePath = Path;
232+
MemberName = Name;
233+
}
234+
StringRef getArchivePath() const { return ArchivePath; }
235+
StringRef getMemberName() const { return MemberName; }
233236

234237
private:
235238
ArrayRef<Symbol> module_symbols(unsigned I) const {

llvm/lib/DTLTO/Dtlto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Error saveInputArchiveMember(lto::LTO &LtoObj, lto::InputFile *Input) {
196196

197197
// Iterates through all ThinLTO-enabled input files and saves their content
198198
// to separate files if they are regular archive members.
199-
Error saveInputArchiveMembers(lto::LTO& LtoObj) {
199+
Error saveInputArchiveMembers(lto::LTO &LtoObj) {
200200
for (auto &Input : LtoObj.InputFiles) {
201201
if (!Input->isThinLTO())
202202
continue;

0 commit comments

Comments
 (0)