]> granicus.if.org Git - clang/commitdiff
Simplify.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 17 Oct 2009 03:28:56 +0000 (03:28 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 17 Oct 2009 03:28:56 +0000 (03:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84307 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index fd96e95afc3d2127e64391e1bcdfb053dffea85e..0ec247958c367b72c4196137f32d58101c654ac5 100644 (file)
@@ -3968,9 +3968,7 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,
   }
 
   // Extension in C99.  Legal in C90, but warn about it.
-  static const unsigned int BuiltinLen = strlen("__builtin_");
-  if (II.getLength() > BuiltinLen &&
-      std::equal(II.getName(), II.getName() + BuiltinLen, "__builtin_"))
+  if (II.getNameStr().startswith("__builtin_"))
     Diag(Loc, diag::warn_builtin_unknown) << &II;
   else if (getLangOptions().C99)
     Diag(Loc, diag::ext_implicit_function_decl) << &II;