Skip to content

Commit 469144f

Browse files
committed
[ELF] De-template InputSectionBase::getEnclosingFunction
1 parent 213896b commit 469144f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Diff for: lld/ELF/InputSection.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ InputSection *InputSectionBase::getLinkOrderDep() const {
268268
}
269269

270270
// Find a function symbol that encloses a given location.
271-
template <class ELFT>
272271
Defined *InputSectionBase::getEnclosingFunction(uint64_t offset) {
273272
for (Symbol *b : file->getSymbols())
274273
if (Defined *d = dyn_cast<Defined>(b))
@@ -289,7 +288,7 @@ std::string InputSectionBase::getLocation(uint64_t offset) {
289288
return (config->outputFile + ":(" + secAndOffset).str();
290289

291290
std::string file = toString(getFile<ELFT>());
292-
if (Defined *d = getEnclosingFunction<ELFT>(offset))
291+
if (Defined *d = getEnclosingFunction(offset))
293292
return file + ":(function " + toString(*d) + ": " + secAndOffset;
294293

295294
return file + ":(" + secAndOffset;
@@ -1203,7 +1202,7 @@ void InputSectionBase::adjustSplitStackFunctionPrologues(uint8_t *buf,
12031202
if (enclosingPrologueAttempted(rel.offset, prologues))
12041203
continue;
12051204

1206-
if (Defined *f = getEnclosingFunction<ELFT>(rel.offset)) {
1205+
if (Defined *f = getEnclosingFunction(rel.offset)) {
12071206
prologues.insert(f);
12081207
if (target->adjustPrologueForCrossSplitStack(buf + f->value, end,
12091208
f->stOther))

Diff for: lld/ELF/InputSection.h

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ class InputSectionBase : public SectionBase {
178178

179179
// Get the function symbol that encloses this offset from within the
180180
// section.
181-
template <class ELFT>
182181
Defined *getEnclosingFunction(uint64_t offset);
183182

184183
// Returns a source location string. Used to construct an error message.

0 commit comments

Comments
 (0)