mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Reduce code repetition. NFC.
llvm-svn: 260476
This commit is contained in:
@@ -725,20 +725,10 @@ StringRef Writer<ELFT>::getOutputSectionName(StringRef S) const {
|
||||
if (It != std::end(InputToOutputSection))
|
||||
return It->second;
|
||||
|
||||
if (S.startswith(".text."))
|
||||
return ".text";
|
||||
if (S.startswith(".rodata."))
|
||||
return ".rodata";
|
||||
if (S.startswith(".data.rel.ro"))
|
||||
return ".data.rel.ro";
|
||||
if (S.startswith(".data."))
|
||||
return ".data";
|
||||
if (S.startswith(".bss."))
|
||||
return ".bss";
|
||||
if (S.startswith(".init_array."))
|
||||
return ".init_array";
|
||||
if (S.startswith(".fini_array."))
|
||||
return ".fini_array";
|
||||
for (StringRef V : {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.",
|
||||
".init_array.", ".fini_array."})
|
||||
if (S.startswith(V))
|
||||
return V.drop_back();
|
||||
return S;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user