diff options
-rw-r--r-- | AST/Expr.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/AST/Expr.cpp b/AST/Expr.cpp index 88c1b236e8..f02e817f06 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -130,9 +130,16 @@ bool CallExpr::isBuiltinConstantExpr() const { if (!DRE) return false; - // We have a DeclRefExpr. - if (strcmp(DRE->getDecl()->getName(), - "__builtin___CFStringMakeConstantString") == 0) + const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(DRE->getDecl()); + if (!FDecl) + return false; + + unsigned builtinID = FDecl->getIdentifier()->getBuiltinID(); + if (!builtinID) + return false; + + // We have a builtin that is a constant expression + if (builtinID == Builtin::BI__builtin___CFStringMakeConstantString) return true; return false; } |