mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Use StringRef::startswith to do some string comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143982 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c545322c27
commit
2ea402541f
@ -525,20 +525,17 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool isObjCClass(StringRef Name) {
|
static bool isObjCClass(StringRef Name) {
|
||||||
if (Name == "") return false;
|
return Name.startswith("+") || Name.startswith("-");
|
||||||
return Name[0] == '+' || Name[0] == '-';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool hasObjCCategory(StringRef Name) {
|
static bool hasObjCCategory(StringRef Name) {
|
||||||
if (Name[0] != '+' && Name[0] != '-')
|
if (!isObjCClass(Name)) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
size_t pos = Name.find(')');
|
size_t pos = Name.find(')');
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
if (Name[pos+1] != ' ') return false;
|
if (Name[pos+1] != ' ') return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user