OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f85784
)
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
Stephen Hines
<srhines@google.com>
Mon, 14 Nov 2011 17:11:55 +0000
(09:11 -0800)
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
d3414d7
..
39d0d1c
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;
}