Fix buildbots after c074f5234d29439116f0e0be6033ea9331e85394.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 28 Feb 2020 12:06:53 +0000 (15:06 +0300)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 28 Feb 2020 13:20:29 +0000 (16:20 +0300)
Removed unused function getSectionByName() from dsymutil/DwarfStreamer.cpp.

llvm/tools/dsymutil/DwarfStreamer.cpp

index d000c454fd4f9920ca10d0dee4101ebac93039c6..8719054f40dbd0fefe179dbf71c27ae1806eaf75 100644 (file)
 namespace llvm {
 namespace dsymutil {
 
-/// Retrieve the section named \a SecName in \a Obj.
-///
-/// To accommodate for platform discrepancies, the name passed should be
-/// (for example) 'debug_info' to match either '__debug_info' or '.debug_info'.
-/// This function will strip the initial platform-specific characters.
-static Optional<object::SectionRef>
-getSectionByName(const object::ObjectFile &Obj, StringRef SecName) {
-  for (const object::SectionRef &Section : Obj.sections()) {
-    StringRef SectionName;
-    if (Expected<StringRef> NameOrErr = Section.getName())
-      SectionName = *NameOrErr;
-    else
-      consumeError(NameOrErr.takeError());
-
-    SectionName = SectionName.substr(SectionName.find_first_not_of("._"));
-    if (SectionName != SecName)
-      continue;
-    return Section;
-  }
-  return None;
-}
-
 bool DwarfStreamer::init(Triple TheTriple) {
   std::string ErrorStr;
   std::string TripleName;