[lld] 8d8fce8 - [ELF] De-template getErrorPlace. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 29 23:05:58 PST 2022


Author: Fangrui Song
Date: 2022-01-29T23:05:54-08:00
New Revision: 8d8fce87bbd5d489025c3dace72884bc97fa72f6

URL: https://github.com/llvm/llvm-project/commit/8d8fce87bbd5d489025c3dace72884bc97fa72f6
DIFF: https://github.com/llvm/llvm-project/commit/8d8fce87bbd5d489025c3dace72884bc97fa72f6.diff

LOG: [ELF] De-template getErrorPlace. NFC

Added: 
    

Modified: 
    lld/ELF/Target.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index f0e7ebfc64df0..7bc5121eabe4a 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -91,7 +91,7 @@ TargetInfo *elf::getTarget() {
   llvm_unreachable("unknown target machine");
 }
 
-template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *loc) {
+ErrorPlace elf::getErrorPlace(const uint8_t *loc) {
   assert(loc != nullptr);
   for (InputSectionBase *d : inputSections) {
     auto *isec = cast<InputSection>(d);
@@ -118,21 +118,6 @@ template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *loc) {
   return {};
 }
 
-ErrorPlace elf::getErrorPlace(const uint8_t *loc) {
-  switch (config->ekind) {
-  case ELF32LEKind:
-    return getErrPlace<ELF32LE>(loc);
-  case ELF32BEKind:
-    return getErrPlace<ELF32BE>(loc);
-  case ELF64LEKind:
-    return getErrPlace<ELF64LE>(loc);
-  case ELF64BEKind:
-    return getErrPlace<ELF64BE>(loc);
-  default:
-    llvm_unreachable("unknown ELF type");
-  }
-}
-
 TargetInfo::~TargetInfo() {}
 
 int64_t TargetInfo::getImplicitAddend(const uint8_t *buf, RelType type) const {


        


More information about the llvm-commits mailing list