]> granicus.if.org Git - clang/commitdiff
a more efficient test for __builtin_classify_type
authorChris Lattner <sabre@nondot.org>
Mon, 6 Oct 2008 04:48:17 +0000 (04:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 6 Oct 2008 04:48:17 +0000 (04:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57149 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index 14b7b51ebb0213ce8772956ee6ba42c6e3351658..82ca82e0e41828634ac35c11356d619560cc673f 100644 (file)
@@ -188,7 +188,8 @@ bool CallExpr::isBuiltinClassifyType(llvm::APSInt &Result) const {
     return false;
 
   // We have a DeclRefExpr.
-  if (strcmp(DRE->getDecl()->getName(), "__builtin_classify_type") == 0) {
+  if (DRE->getDecl()->getIdentifier()->getBuiltinID() ==
+         Builtin::BI__builtin_classify_type) {
     // If no argument was supplied, default to "no_type_class". This isn't 
     // ideal, however it's what gcc does.
     Result = static_cast<uint64_t>(no_type_class);