@@ -742,7 +742,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
742742 if (EF.getHeader ().e_machine == ELF::EM_AARCH64) {
743743 if (Expected<StringRef> NameOrErr = getSymbolName (Sym)) {
744744 StringRef Name = *NameOrErr;
745- if (Name.startswith (" $d" ) || Name.startswith (" $x" ))
745+ if (Name.starts_with (" $d" ) || Name.starts_with (" $x" ))
746746 Result |= SymbolRef::SF_FormatSpecific;
747747 } else {
748748 // TODO: Actually report errors helpfully.
@@ -752,8 +752,8 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
752752 if (Expected<StringRef> NameOrErr = getSymbolName (Sym)) {
753753 StringRef Name = *NameOrErr;
754754 // TODO Investigate why empty name symbols need to be marked.
755- if (Name.empty () || Name.startswith (" $d" ) || Name.startswith (" $t" ) ||
756- Name.startswith (" $a" ))
755+ if (Name.empty () || Name.starts_with (" $d" ) || Name.starts_with (" $t" ) ||
756+ Name.starts_with (" $a" ))
757757 Result |= SymbolRef::SF_FormatSpecific;
758758 } else {
759759 // TODO: Actually report errors helpfully.
@@ -764,7 +764,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
764764 } else if (EF.getHeader ().e_machine == ELF::EM_CSKY) {
765765 if (Expected<StringRef> NameOrErr = getSymbolName (Sym)) {
766766 StringRef Name = *NameOrErr;
767- if (Name.startswith (" $d" ) || Name.startswith (" $t" ))
767+ if (Name.starts_with (" $d" ) || Name.starts_with (" $t" ))
768768 Result |= SymbolRef::SF_FormatSpecific;
769769 } else {
770770 // TODO: Actually report errors helpfully.
@@ -775,7 +775,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
775775 StringRef Name = *NameOrErr;
776776 // Mark empty name symbols (used for label differences) and mapping
777777 // symbols.
778- if (Name.empty () || Name.startswith (" $d" ) || Name.startswith (" $x" ))
778+ if (Name.empty () || Name.starts_with (" $d" ) || Name.starts_with (" $x" ))
779779 Result |= SymbolRef::SF_FormatSpecific;
780780 } else {
781781 // TODO: Actually report errors helpfully.
@@ -973,8 +973,8 @@ bool ELFObjectFile<ELFT>::isDebugSection(DataRefImpl Sec) const {
973973 return false ;
974974 }
975975 StringRef SectionName = SectionNameOrErr.get ();
976- return SectionName.startswith (" .debug" ) ||
977- SectionName.startswith (" .zdebug" ) || SectionName == " .gdb_index" ;
976+ return SectionName.starts_with (" .debug" ) ||
977+ SectionName.starts_with (" .zdebug" ) || SectionName == " .gdb_index" ;
978978}
979979
980980template <class ELFT >
0 commit comments