mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Use StringRef::startswith to do some string comparisons.
llvm-svn: 143982
This commit is contained in:
parent
1132780088
commit
2b26dd515a
@ -525,20 +525,17 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
|
||||
}
|
||||
|
||||
static bool isObjCClass(StringRef Name) {
|
||||
if (Name == "") return false;
|
||||
return Name[0] == '+' || Name[0] == '-';
|
||||
return Name.startswith("+") || Name.startswith("-");
|
||||
}
|
||||
|
||||
static bool hasObjCCategory(StringRef Name) {
|
||||
if (Name[0] != '+' && Name[0] != '-')
|
||||
return false;
|
||||
if (!isObjCClass(Name)) return false;
|
||||
|
||||
size_t pos = Name.find(')');
|
||||
if (pos != std::string::npos) {
|
||||
if (Name[pos+1] != ' ') return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user