summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-11-07 18:53:23 +0000
committerEric Christopher <echristo@apple.com>2011-11-07 18:53:23 +0000
commit988ac00abdfcc7b8e486e77b67de408e9ebbd096 (patch)
tree7d3f18e5d5995ee5a3af4acaeba010304bbf55fe /llvm/lib/CodeGen/AsmPrinter
parentd569791c448e7ed25b94fb4005ad370433b7b020 (diff)
downloadbcm5719-llvm-988ac00abdfcc7b8e486e77b67de408e9ebbd096.tar.gz
bcm5719-llvm-988ac00abdfcc7b8e486e77b67de408e9ebbd096.zip
Use StringRef::startswith to do some string comparisons.
llvm-svn: 143982
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d3414d7be55..39d0d1c96bb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud