[llvm] r201798 - Remove unnecessary copy of array_lengthof.
Benjamin Kramer
benny.kra at googlemail.com
Thu Feb 20 09:36:31 PST 2014
Author: d0k
Date: Thu Feb 20 11:36:31 2014
New Revision: 201798
URL: http://llvm.org/viewvc/llvm-project?rev=201798&view=rev
Log:
Remove unnecessary copy of array_lengthof.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=201798&r1=201797&r2=201798&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Thu Feb 20 11:36:31 2014
@@ -9097,9 +9097,6 @@ static const struct ExtMapEntry {
{ "xscale", Feature_None, 0 },
};
-template <typename T, size_t N>
-size_t countof(const T (&)[N]) { return N; }
-
/// parseDirectiveArchExtension
/// ::= .arch_extension [no]feature
bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) {
@@ -9114,12 +9111,12 @@ bool ARMAsmParser::parseDirectiveArchExt
getLexer().Lex();
bool EnableFeature = true;
- if (!Extension.lower().compare(0, 2, "no")) {
+ if (Extension.startswith_lower("no")) {
EnableFeature = false;
Extension = Extension.substr(2);
}
- for (unsigned EI = 0, EE = countof(Extensions); EI != EE; ++EI) {
+ for (unsigned EI = 0, EE = array_lengthof(Extensions); EI != EE; ++EI) {
if (Extensions[EI].Extension != Extension)
continue;
More information about the llvm-commits
mailing list