diff options
Diffstat (limited to 'lld/ELF/MarkLive.cpp')
-rw-r--r-- | lld/ELF/MarkLive.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index bb0105c28928..28e13e8c1234 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -31,17 +31,17 @@ #include "lld/Common/Strings.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Object/ELF.h" +#include "llvm/Support/TimeProfiler.h" #include <functional> #include <vector> using namespace llvm; using namespace llvm::ELF; using namespace llvm::object; +using namespace llvm::support::endian; +using namespace lld; +using namespace lld::elf; -namespace endian = llvm::support::endian; - -namespace lld { -namespace elf { namespace { template <class ELFT> class MarkLive { public: @@ -141,7 +141,7 @@ void MarkLive<ELFT>::scanEhFrameSection(EhInputSection &eh, if (firstRelI == (unsigned)-1) continue; - if (endian::read32<ELFT::TargetEndianness>(piece.data().data() + 4) == 0) { + if (read32<ELFT::TargetEndianness>(piece.data().data() + 4) == 0) { // This is a CIE, we only need to worry about the first relocation. It is // known to point to the personality function. resolveReloc(eh, rels[firstRelI], false); @@ -322,7 +322,8 @@ template <class ELFT> void MarkLive<ELFT>::moveToMain() { // Before calling this function, Live bits are off for all // input sections. This function make some or all of them on // so that they are emitted to the output file. -template <class ELFT> void markLive() { +template <class ELFT> void elf::markLive() { + llvm::TimeTraceScope timeScope("markLive"); // If -gc-sections is not given, no sections are removed. if (!config->gcSections) { for (InputSectionBase *sec : inputSections) @@ -390,10 +391,7 @@ template <class ELFT> void markLive() { message("removing unused section " + toString(sec)); } -template void markLive<ELF32LE>(); -template void markLive<ELF32BE>(); -template void markLive<ELF64LE>(); -template void markLive<ELF64BE>(); - -} // namespace elf -} // namespace lld +template void elf::markLive<ELF32LE>(); +template void elf::markLive<ELF32BE>(); +template void elf::markLive<ELF64LE>(); +template void elf::markLive<ELF64BE>(); |