Skip to content

Commit af3983e

Browse files
[IRGen] Remove unused ObjC selector-family-related code
1 parent 3cca85f commit af3983e

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

lib/IRGen/GenObjC.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -487,21 +487,6 @@ namespace {
487487

488488
static constexpr struct ForGetter_t { } ForGetter{};
489489
static constexpr struct ForSetter_t { } ForSetter{};
490-
491-
#define FOREACH_FAMILY(FAMILY) \
492-
FAMILY(Alloc, "alloc") \
493-
FAMILY(Copy, "copy") \
494-
FAMILY(Init, "init") \
495-
FAMILY(MutableCopy, "mutableCopy") \
496-
FAMILY(New, "new")
497-
498-
// Note that these are in parallel with 'prefixes', below.
499-
enum class Family {
500-
None,
501-
#define GET_LABEL(LABEL, PREFIX) LABEL,
502-
FOREACH_FAMILY(GET_LABEL)
503-
#undef GET_LABEL
504-
};
505490

506491
Selector() = default;
507492

@@ -571,31 +556,6 @@ namespace {
571556
StringRef str() const {
572557
return Text;
573558
}
574-
575-
/// Return the family string of this selector.
576-
Family getFamily() const {
577-
StringRef text = str();
578-
while (!text.empty() && text[0] == '_') text = text.substr(1);
579-
580-
#define CHECK_PREFIX(LABEL, PREFIX) \
581-
if (hasPrefix(text, PREFIX)) return Family::LABEL;
582-
FOREACH_FAMILY(CHECK_PREFIX)
583-
#undef CHECK_PREFIX
584-
585-
return Family::None;
586-
}
587-
588-
private:
589-
/// Does the given selector start with the given string as a
590-
/// prefix, in the sense of the selector naming conventions?
591-
static bool hasPrefix(StringRef text, StringRef prefix) {
592-
if (!text.startswith(prefix)) return false;
593-
if (text.size() == prefix.size()) return true;
594-
assert(text.size() > prefix.size());
595-
return !clang::isLowercase(text[prefix.size()]);
596-
}
597-
598-
#undef FOREACH_FAMILY
599559
};
600560
} // end anonymous namespace
601561

0 commit comments

Comments
 (0)