- Feb 16, 2009
-
-
Daniel Dunbar authored
- 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
-
Daniel Dunbar authored
- Fix test case to not only have negative tests. llvm-svn: 64674
-
- Feb 14, 2009
-
-
Douglas Gregor authored
etc.) when we perform name lookup on them. This ensures that we produce the correct signature for these functions, which has two practical impacts: 1) When we're supporting the "implicit function declaration" feature of C99, these functions will be implicitly declared with the right signature rather than as a function returning "int" with no prototype. See PR3541 for the reason why this is important (hint: GCC always predeclares these functions). 2) If users attempt to redeclare one of these library functions with an incompatible signature, we produce a hard error. This patch does a little bit of work to give reasonable error messages. For example, when we hit case #1 we complain that we're implicitly declaring this function with a specific signature, and then we give a note that asks the user to include the appropriate header (e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In case #2, we show the type of the implicit builtin that was incorrectly declared, so the user can see the problem. We could do better here: for example, when displaying this latter error message we say something like: 'strcpy' was implicitly declared here with type 'char *(char *, char const *)' but we should really print out a fake code line showing the declaration, like this: 'strcpy' was implicitly declared here as: char *strcpy(char *, char const *) This would also be good for printing built-in candidates with C++ operator overloading. The set of C library functions supported by this patch includes all functions from the C99 specification's <stdlib.h> and <string.h> that (a) are predefined by GCC and (b) have signatures that could cause codegen issues if they are treated as functions with no prototype returning and int. Future work could extend this set of functions to other C library functions that we know about. llvm-svn: 64504
-
- Feb 11, 2009
-
-
Daniel Dunbar authored
case on x86_64. llvm-svn: 64333
-
- Feb 05, 2009
-
-
Dale Johannesen authored
Untested, Daniel or Nate please review. llvm-svn: 63814
-
Daniel Dunbar authored
r63765). llvm-svn: 63795
-
- Feb 04, 2009
-
-
Daniel Dunbar authored
llvm-svn: 63773
-
- Jan 25, 2009
-
-
Eli Friedman authored
__builtin___CFStringMakeConstantString. (We get into trouble in GenerateStaticBlockVarDecl if the constant folder isn't accurate.) llvm-svn: 62949
-
- Jan 20, 2009
-
-
Eli Friedman authored
struct. llvm-svn: 62585
-
Eli Friedman authored
va_list is a struct, like x86-64. If anyone has a better idea for how to do the check in the if statements, suggestions are welcome. llvm-svn: 62582
-
Eli Friedman authored
builtins. Also, a minor tweak to va_copy for consistency. llvm-svn: 62574
-
- Jan 18, 2009
-
-
Nate Begeman authored
llvm-svn: 62458
-
- Dec 22, 2008
-
-
Anders Carlsson authored
llvm-svn: 61324
-
- Dec 01, 2008
-
-
Anders Carlsson authored
llvm-svn: 60321
-
- Nov 16, 2008
-
-
Chris Lattner authored
llvm-svn: 59426
-
- Nov 04, 2008
-
-
Anders Carlsson authored
llvm-svn: 58680
-
- Oct 29, 2008
-
-
Eli Friedman authored
va_list, not the value. Patch fixes an assert on x86-64 and a wrong-code bug on x86. I'm not completely sure, but I think it's a regression from r58306. Does anyone run regression tests regularly on x86-64? The crash should have been picked up there. llvm-svn: 58366
-
- Oct 15, 2008
-
-
Mon P Wang authored
llvm-svn: 57563
-
- Oct 10, 2008
-
-
Daniel Dunbar authored
llvm-svn: 57335
-
- Oct 06, 2008
-
-
Chris Lattner authored
constant lvalue. Implement this in codegen by moving the code out of CGBuiltin into EmitConstantExpr. llvm-svn: 57163
-
Chris Lattner authored
it is possible that a builtin could sometimes be folded (e.g. __builtin_clz) if it's operand is a constant. llvm-svn: 57161
-
Chris Lattner authored
llvm-svn: 57157
-
Chris Lattner authored
do it instead. We should still handle __builtin_nan etc, but don't yet. This fixes incorrect evaluation of __builtin_constant_p, a FIXME. llvm-svn: 57156
-
- Sep 30, 2008
-
-
Mon P Wang authored
llvm-svn: 56830
-
- Sep 03, 2008
-
-
Daniel Dunbar authored
- Currently CodeGen always returns a conservative value for this (-1 or 0 depending on the context). llvm-svn: 55735
-
- Aug 30, 2008
-
-
Anders Carlsson authored
llvm-svn: 55567
-
- Aug 16, 2008
-
-
Daniel Dunbar authored
- We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
-
- Aug 11, 2008
-
-
Daniel Dunbar authored
- Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
-
Daniel Dunbar authored
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
-
- Jul 31, 2008
-
-
Mon P Wang authored
different address spaces) for llvm r54195. llvm-svn: 54241
-
- Jul 25, 2008
-
-
Nate Begeman authored
llvm-svn: 54049
-
- Jul 23, 2008
-
-
Chris Lattner authored
llvm-svn: 53948
-
- Jul 22, 2008
-
-
Daniel Dunbar authored
This subsumes Nico Weber's patch and implements bzero in terms of llvm.memset to match llvm-gcc. llvm-svn: 53888
-
Daniel Dunbar authored
This closes <rdar://problem/6080720>, support for __builtin_constant_p has been filed separately. llvm-svn: 53885
-
- Jul 21, 2008
-
-
Daniel Dunbar authored
llvm-svn: 53878
-
Daniel Dunbar authored
llvm-svn: 53866
-
Daniel Dunbar authored
+ test case llvm-svn: 53851
-
- Jul 18, 2008
-
-
Mon P Wang authored
llvm-svn: 53747
-
- Jul 09, 2008
-
-
Chris Lattner authored
llvm-svn: 53329
-
- Jun 30, 2008
-
-
Chris Lattner authored
1) add a new ASTContext::getFloatTypeSemantics method. 2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places. 3) Change the TargetInfo.h get*Format methods to return their fltSemantics byref instead of by pointer. 4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which sometimes expand specially and othertimes fall back to libm. 5) Add support for __builtin_nan("") to codegen, cases that don't pass in an empty string are currently lowered to libm calls. 6) Fix codegen of __builtin_infl. llvm-svn: 52914
-