[LTO] Avoid repeated Triple construction. NFC

This commit is contained in:
Fangrui Song 2021-09-28 13:39:41 -07:00
parent b12e4c17e0
commit 595c418ad6
1 changed files with 1 additions and 1 deletions

View File

@ -537,12 +537,12 @@ void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
auto *ResI = Res.begin(); auto *ResI = Res.begin();
auto *ResE = Res.end(); auto *ResE = Res.end();
(void)ResE; (void)ResE;
const Triple TT(RegularLTO.CombinedModule->getTargetTriple());
for (const InputFile::Symbol &Sym : Syms) { for (const InputFile::Symbol &Sym : Syms) {
assert(ResI != ResE); assert(ResI != ResE);
SymbolResolution Res = *ResI++; SymbolResolution Res = *ResI++;
StringRef Name = Sym.getName(); StringRef Name = Sym.getName();
Triple TT(RegularLTO.CombinedModule->getTargetTriple());
// Strip the __imp_ prefix from COFF dllimport symbols (similar to the // Strip the __imp_ prefix from COFF dllimport symbols (similar to the
// way they are handled by lld), otherwise we can end up with two // way they are handled by lld), otherwise we can end up with two
// global resolutions (one with and one for a copy of the symbol without). // global resolutions (one with and one for a copy of the symbol without).