diff options
author | Eric Christopher <echristo@apple.com> | 2011-11-07 18:53:23 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-11-07 18:53:23 +0000 |
commit | 2ea402541fa1bd2aa9942abf7b281ef01f9a10ff (patch) | |
tree | 9d7be2d6fd06036139aa08394eb06f5d17c237c4 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | c545322c276f933759e4140027e5f84e480d15d6 (diff) | |
download | external_llvm-2ea402541fa1bd2aa9942abf7b281ef01f9a10ff.zip external_llvm-2ea402541fa1bd2aa9942abf7b281ef01f9a10ff.tar.gz external_llvm-2ea402541fa1bd2aa9942abf7b281ef01f9a10ff.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d3414d7..39d0d1c 100644 --- 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; } |