From e9391a5cfc1d7e1ba17bf84603643e33ff2f5f5a Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 20 Feb 2014 17:36:31 +0000 Subject: Remove unnecessary copy of array_lengthof. llvm-svn: 201798 --- llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp') diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 1d300a66c5d..f84f4bcf5c5 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -9097,9 +9097,6 @@ static const struct ExtMapEntry { { "xscale", Feature_None, 0 }, }; -template -size_t countof(const T (&)[N]) { return N; } - /// parseDirectiveArchExtension /// ::= .arch_extension [no]feature bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) { @@ -9114,12 +9111,12 @@ bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) { 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; -- cgit v1.2.3