summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* __builtin_object_size refinements. Ensure we handle expressions withMike Stump2009-10-271-5/+7
| | | | | | | | | | side-effects up front, as when we switch to the llvm intrinsic call for __builtin_object_size later, it will have two evaluations. We also finish off the intrinsic version of the code so we can just turn it on once llvm has the intrinsic. llvm-svn: 85324
* Prep for future __builtin_object_size refinements. The theory is thatMike Stump2009-10-261-0/+11
| | | | | | | | | | someone will add an llvm intrinsic for us to use, so the optimizer can figure out the hard cases. WIP. For those that want to help, double check with Eric before starting. He has a bit of code this will plug into. llvm-svn: 85175
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-131-10/+6
| | | | llvm-svn: 83964
* Implement __builtin_unreachable(), a GCC 4.5 extension.Chris Lattner2009-09-211-1/+6
| | | | llvm-svn: 82433
* Fix subtle bug in generating LLVM function declarations for builtin functions.Daniel Dunbar2009-09-141-1/+1
| | | | | | | | | | The decl wasn't being passed down, which meant that function attributes were not being set correctly. This is particularly important for ARM, since it wants to override the calling convention. Instead we would emit the builtin with the wrong calling convention, and instcombine would come along and merrily shred all the calls to it. :) llvm-svn: 81756
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-77/+77
| | | | llvm-svn: 81346
* PR4836, part 2: CodeGen for __builtin_isnan.Eli Friedman2009-09-011-0/+5
| | | | llvm-svn: 80655
* Remove TargetInfo::getTargetPrefix().Daniel Dunbar2009-08-241-6/+12
| | | | llvm-svn: 79907
* Update for LLVM API change.Owen Anderson2009-08-131-31/+31
| | | | llvm-svn: 78946
* Update for LLVM API change.Owen Anderson2009-07-311-3/+3
| | | | llvm-svn: 77722
* Update for LLVM API changes.Owen Anderson2009-07-301-2/+2
| | | | llvm-svn: 77638
* Update for LLVM API change.Owen Anderson2009-07-291-9/+9
| | | | llvm-svn: 77514
* Update for LLVM API change.Owen Anderson2009-07-271-1/+1
| | | | llvm-svn: 77249
* Switch to getName()Daniel Dunbar2009-07-261-1/+1
| | | | llvm-svn: 77151
* Update for LLVM API change.Owen Anderson2009-07-241-17/+18
| | | | llvm-svn: 77012
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-32/+33
| | | | llvm-svn: 75705
* Update for LLVM API change.Owen Anderson2009-07-131-3/+4
| | | | llvm-svn: 75446
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-2/+2
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-2/+2
| | | | llvm-svn: 73702
* move the various builtins stuff from libast to libbasic. ThisChris Lattner2009-06-141-1/+1
| | | | | | fixes a layering violation in lib/Basic/Targets.cpp. llvm-svn: 73318
* Remove a few more vector builtins.Eli Friedman2009-06-071-23/+0
| | | | llvm-svn: 73022
* Now that LLVM CodeGen can handle the generic variations a bit better, Eli Friedman2009-06-071-22/+0
| | | | | | get rid of a few more clang vector builtins. llvm-svn: 73015
* Get rid of a bunch of dead builtins.Eli Friedman2009-06-061-199/+0
| | | | llvm-svn: 72996
* Add support for __builtin_unwind_init.Eli Friedman2009-06-021-0/+30
| | | | | | | | Also, committing an #if 0'ed __builtin_setjmp and __builtin_longjmp implementation I've had sitting in my tree for a while. I haven't enabled it because the LLVM backend support isn't complete yet. llvm-svn: 72727
* If we recognize alloca, treat it as a builtin. This fixes uses of Eli Friedman2009-06-021-0/+1
| | | | | | alloca without declaring it. llvm-svn: 72719
* Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar ↵Daniel Dunbar2009-05-271-2/+2
| | | | | | RValue. llvm-svn: 72504
* Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't ↵Anders Carlsson2009-05-271-3/+3
| | | | | | emit an expr. llvm-svn: 72446
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Remove an unused builtin.Anders Carlsson2009-05-181-4/+0
| | | | llvm-svn: 72033
* Add 'cmp' SSE builtins and get rid of a bunch of other builtins.Anders Carlsson2009-05-181-154/+14
| | | | llvm-svn: 72032
* implement __sync_synchronize and __sync_lock_release,Chris Lattner2009-05-131-3/+15
| | | | | | rdar://6880573 llvm-svn: 71637
* add support for __sync_nand_and_fetch and __sync_fetch_and_nand,Chris Lattner2009-05-131-2/+20
| | | | | | rdar://6880573 llvm-svn: 71636
* reimplement __sync_* builtins to be variadic and to follow the sameChris Lattner2009-05-081-18/+94
| | | | | | | | | semantic rules that gcc and icc use. This implements the variadic and concrete versions as builtins and has sema do the disambiguation. There are probably a bunch of details to finish up but this seems like a large monotonic step forward :) llvm-svn: 71212
* PR4134: Implement __builtin_extract_return_addr.Eli Friedman2009-05-031-1/+4
| | | | llvm-svn: 70794
* Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman2009-04-261-2/+1
| | | | llvm-svn: 70145
* fix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924Chris Lattner2009-04-181-1/+2
| | | | llvm-svn: 69428
* Update to use hasAttr() instead of getAttr().Daniel Dunbar2009-04-131-2/+2
| | | | | | - No functionality change. llvm-svn: 68987
* Add a destination type argument to EmitConstantExpr. This will be used for ↵Anders Carlsson2009-04-081-1/+1
| | | | | | when the destination has a reference type. (No functionality change yet) llvm-svn: 68593
* Implement __sync_{add,sub,and,or,xor}_and_fetch andDaniel Dunbar2009-04-071-9/+59
| | | | | | | | __sync_bool_compare_and_swap. - <rdar://problem/6762223> [sema/irgen] support __sync_bool_compare_and_swap and __sync_add_and_fetch llvm-svn: 68482
* Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.Daniel Dunbar2009-02-161-1/+30
| | | | | | | | | | | | | | | | - 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
* Fix IRgen of __builtin_memset.Daniel Dunbar2009-02-161-1/+2
| | | | | | - Fix test case to not only have negative tests. llvm-svn: 64674
* Implicitly declare certain C library functions (malloc, strcpy, memmove,Douglas Gregor2009-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use EmitVAListRef instead of EmitLValue directly to handle array decayDaniel Dunbar2009-02-111-1/+1
| | | | | | case on x86_64. llvm-svn: 64333
* Reapply Daniel's patch to match up with llvm 63765.Dale Johannesen2009-02-051-6/+3
| | | | | | Untested, Daniel or Nate please review. llvm-svn: 63814
* Chase LLVM TOT in circles (i.e., revert r63773 to match revert ofDaniel Dunbar2009-02-041-3/+6
| | | | | | r63765). llvm-svn: 63795
* (llvm up) Update for intrinsic lookup changes.Daniel Dunbar2009-02-041-6/+3
| | | | llvm-svn: 63773
* Make the constant folder aware of Eli Friedman2009-01-251-2/+2
| | | | | | | __builtin___CFStringMakeConstantString. (We get into trouble in GenerateStaticBlockVarDecl if the constant folder isn't accurate.) llvm-svn: 62949
* Slight cleanup, and fix for va_arg on architectures where va_list is a Eli Friedman2009-01-201-14/+3
| | | | | | struct. llvm-svn: 62585
* Do codegen correctly for va_start/end/copy on architectures where Eli Friedman2009-01-201-4/+14
| | | | | | | | | 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
* Fix for PR3350: add special-casing for "references" to va_lists in Eli Friedman2009-01-201-5/+1
| | | | | | | | builtins. Also, a minor tweak to va_copy for consistency. llvm-svn: 62574
OpenPOWER on IntegriCloud