@@ -247,8 +247,8 @@ bool ICF<ELFT>::constantEq(const InputSection *secA, ArrayRef<RelTy> ra,
247247 uint64_t addA = getAddend<ELFT>(ra[i]);
248248 uint64_t addB = getAddend<ELFT>(rb[i]);
249249
250- Symbol &sa = secA->template getFile <ELFT>() ->getRelocTargetSym (ra[i]);
251- Symbol &sb = secB->template getFile <ELFT>() ->getRelocTargetSym (rb[i]);
250+ Symbol &sa = secA->file ->getRelocTargetSym (ra[i]);
251+ Symbol &sb = secB->file ->getRelocTargetSym (rb[i]);
252252 if (&sa == &sb) {
253253 if (addA == addB)
254254 continue ;
@@ -338,8 +338,8 @@ bool ICF<ELFT>::variableEq(const InputSection *secA, ArrayRef<RelTy> ra,
338338
339339 for (size_t i = 0 ; i < ra.size (); ++i) {
340340 // The two sections must be identical.
341- Symbol &sa = secA->template getFile <ELFT>() ->getRelocTargetSym (ra[i]);
342- Symbol &sb = secB->template getFile <ELFT>() ->getRelocTargetSym (rb[i]);
341+ Symbol &sa = secA->file ->getRelocTargetSym (ra[i]);
342+ Symbol &sb = secB->file ->getRelocTargetSym (rb[i]);
343343 if (&sa == &sb)
344344 continue ;
345345
@@ -437,12 +437,12 @@ void ICF<ELFT>::forEachClass(llvm::function_ref<void(size_t, size_t)> fn) {
437437
438438// Combine the hashes of the sections referenced by the given section into its
439439// hash.
440- template <class ELFT , class RelTy >
440+ template <class RelTy >
441441static void combineRelocHashes (unsigned cnt, InputSection *isec,
442442 ArrayRef<RelTy> rels) {
443443 uint32_t hash = isec->eqClass [cnt % 2 ];
444444 for (RelTy rel : rels) {
445- Symbol &s = isec->template getFile <ELFT>() ->getRelocTargetSym (rel);
445+ Symbol &s = isec->file ->getRelocTargetSym (rel);
446446 if (auto *d = dyn_cast<Defined>(&s))
447447 if (auto *relSec = dyn_cast_or_null<InputSection>(d->section ))
448448 hash += relSec->eqClass [cnt % 2 ];
@@ -504,9 +504,9 @@ template <class ELFT> void ICF<ELFT>::run() {
504504 parallelForEach (sections, [&](InputSection *s) {
505505 const RelsOrRelas<ELFT> rels = s->template relsOrRelas <ELFT>();
506506 if (rels.areRelocsRel ())
507- combineRelocHashes<ELFT> (cnt, s, rels.rels );
507+ combineRelocHashes (cnt, s, rels.rels );
508508 else
509- combineRelocHashes<ELFT> (cnt, s, rels.relas );
509+ combineRelocHashes (cnt, s, rels.relas );
510510 });
511511 }
512512
0 commit comments