projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c545322
)
Use StringRef::startswith to do some string comparisons.
author
Eric Christopher
<echristo@apple.com>
Mon, 7 Nov 2011 18:53:23 +0000
(18:53 +0000)
committer
Eric Christopher
<echristo@apple.com>
Mon, 7 Nov 2011 18:53:23 +0000
(18:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143982
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d3414d7be55b4499b805c66efa823fe157975601..39d0d1c96bbb0416aab994e8deb8b8f4bff0c975 100644
(file)
--- a/
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@
-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;
}