From 8eb018ab9c00c504d8b6d991865a599adbd1da02 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 16 Feb 2009 22:43:43 +0000 Subject: Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow. - Define pow[lf]?, sqrt[lf]? as builtins. - Add -fmath-errno option which binds to LangOptions.MathErrno - Add new builtin flag Builtin::Context::isConstWithoutErrno for functions which can be marked as const if errno isn't respected for math functions. Sema automatically marks these functions as const when they are defined, if MathErrno=0. - IRgen uses const attribute on sqrt and pow library functions to decide if it can use the llvm intrinsic. llvm-svn: 64689 --- clang/lib/CodeGen/CGExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGExpr.cpp') diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 4dc8a9e1d4d..b151dd2102c 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -969,7 +969,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E) { if (const FunctionDecl *FDecl = dyn_cast(DRExpr->getDecl())) if (unsigned builtinID = FDecl->getBuiltinID(getContext())) - return EmitBuiltinExpr(builtinID, E); + return EmitBuiltinExpr(FDecl, builtinID, E); if (E->getCallee()->getType()->isBlockPointerType()) return EmitBlockCallExpr(E); -- cgit v1.2.3