summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-13/+0
| | | | llvm-svn: 176145
* Temporarily revert r176133 until testcases are modified.Bill Wendling2013-02-261-0/+13
| | | | llvm-svn: 176137
* Don't set the -target-cpu and -target-features attributes just now.Bill Wendling2013-02-261-13/+0
| | | | | | | This is causing some problems with some of the builders. It's non-trivial to reset the target's features. llvm-svn: 176133
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-59/+1
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-1/+59
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Revert r175912, "Add support for coldcc to clang" at John's request.Peter Collingbourne2013-02-231-4/+0
| | | | llvm-svn: 175936
* Make sure we apply attributes to correct places.Bill Wendling2013-02-221-13/+17
| | | | | | | Some attributes make sense only on the function or on the call site, but not both. Make this distinction here. llvm-svn: 175918
* Add support for coldcc to clangPeter Collingbourne2013-02-221-0/+4
| | | | llvm-svn: 175912
* Apply the 'nobuiltin' attribute to call sites when the user specifies ↵Bill Wendling2013-02-221-3/+8
| | | | | | `-fno-builtin' on the command line. llvm-svn: 175836
* Temporarily revert r175471 for more review.Bill Wendling2013-02-191-3/+0
| | | | llvm-svn: 175477
* Add a 'no-builtin' attribute if we do not want to simplify calls.Bill Wendling2013-02-181-0/+3
| | | | llvm-svn: 175471
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-0/+13
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Revert accidental commit.Bill Wendling2013-02-141-13/+0
| | | | llvm-svn: 175143
* Pass the target options through to code generation.Bill Wendling2013-02-141-0/+13
| | | | | | | The code generation stuff is going to set attributes on the functions it generates. To do that it needs the target options. Pass them through. llvm-svn: 175141
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-301-8/+6
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-271-22/+13
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173605
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-231-4/+6
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173229
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-1/+2
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-3/+3
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-301-1/+2
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171254
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-251-0/+4
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Rename llvm::Attributes to llvm::Attribute.Bill Wendling2012-12-201-40/+40
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-40/+40
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-40/+40
| | | | | | single attribute in the future. llvm-svn: 170500
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-3/+3
| | | | | | in the near future. llvm-svn: 169652
* Fix the required args count for variadic blocks.John McCall2012-12-071-12/+47
| | | | | | | | | | | | | | | | | We were emitting calls to blocks as if all arguments were required --- i.e. with signature (A,B,C,D,...) rather than (A,B,...). This patch fixes that and accounts for the implicit block-context argument as a required argument. In addition, this patch changes the function type under which we call unprototyped functions on platforms like x86-64 that guarantee compatibility of variadic functions with unprototyped function types; previously we would always call such functions under the LLVM type T (...)*, but now we will call them under the type T (A,B,C,D,...)*. This last change should have no material effect except for making the type conventions more explicit; it was a side-effect of the most convenient implementation. llvm-svn: 169588
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Merge function types in C.Rafael Espindola2012-11-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other differences, GCC accepts typedef int IA[]; typedef int A10[10]; static A10 *f(void); static IA *f(void); void g(void) { (void)sizeof(*f()); } but clang used to reject it with: invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []') The intention of c99's 6.2.7 seems to be that we should use the composite type and accept as gcc does. Doing the type merging required some extra fixes: * Use the type from the function type in initializations, even if an parameter is available. * Fix the merging of the noreturn attribute in function types. * Make CodeGen handle the fact that an parameter type can be different from the corresponding type in the function type. llvm-svn: 168895
* ABI: comments from Eli on r168820.Manman Ren2012-11-281-0/+2
| | | | | | rdar://12723368 llvm-svn: 168821
* ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store ofManman Ren2012-11-281-12/+12
| | | | | | | | | | | | | | | the original parameter or return type. Since we do not accurately represent the data fields of a union, we should not directly load or store a union type. As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as another field type, the first field type will be chosen to represent the union. If we load with the union's type, the 3rd byte and the 4th byte will be skipped. rdar://12723368 llvm-svn: 168820
* objective-C arc: load of a __weak object happens via call toFariborz Jahanian2012-11-271-4/+12
| | | | | | | | | | | objc_loadWeak. This retains and autorelease the weakly-refereced object. This hidden autorelease sometimes makes __weak variable alive even after the weak reference is erased, because the object is still referenced by an autorelease pool. This patch overcomes this behavior by loading a weak object via call to objc_loadWeakRetained(), followng it by objc_release at appropriate place, thereby removing the hidden autorelease. // rdar://10849570 llvm-svn: 168740
* Update method calls to the new interface re r168354.Bill Wendling2012-11-201-1/+2
| | | | llvm-svn: 168355
* Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith2012-11-011-1/+1
| | | | llvm-svn: 167261
* Change ForceSizeOpt attribute into MinSize attributeQuentin Colombet2012-10-301-1/+1
| | | | llvm-svn: 167021
* Oz optimization level sets ForceSizeOpt attribute for each functionQuentin Colombet2012-10-261-0/+2
| | | | llvm-svn: 166744
* Add padding inreg registers to cause llvm to skip ecx when needed withRafael Espindola2012-10-241-15/+27
| | | | | | the x86_fastcallcc calling convention. llvm-svn: 166538
* Fix handling of the regparm attribute in the presence of classes with copyRafael Espindola2012-10-191-0/+3
| | | | | | | | | | | | | constructors. When I first moved regparm support to TargetInfo.cpp I tried to isolate it in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the code around and check for regparm at the end of the decision tree. Without this refactoring classifyArgumentTypeWithReg would have to duplicate the logic about when to use non-byval indirect arguments. llvm-svn: 166266
* Add pnaclcall convention to Native Client targets.Derek Schuff2012-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. llvm-svn: 166065
* Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling2012-10-161-8/+5
| | | | | | simplify the code a bit. No functionality change. llvm-svn: 166010
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-6/+6
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165961
* Use enum values instead of magic numbers for indexing into the attribute list.Bill Wendling2012-10-151-2/+3
| | | | llvm-svn: 165925
* Attributes RewriteBill Wendling2012-10-151-7/+12
| | | | | | | | Convert the uses of the Attributes class over to the new format. The Attributes::get method call now takes an LLVM context so that the attributes object can be uniquified and stored. llvm-svn: 165918
* Apply the same fundamental fix for PR14048 as was applied for PR11905.Chandler Carruth2012-10-101-2/+19
| | | | | | | | | | | | | | | | | | The issue arises when coercing to/from types of different sizes. We need to be certain that the allocation on either end has sufficient room for the coerced type. When it doesn't, we need to make room, copy across, and then proceed. PR11905 handled the case of storing function arguments back into allocas in the function prolog, this patch handles the case of setting up the function arguments in a call expression. This is actually significantly simpler than the fix for PR11905. It ends up being a trivial change to create a temporary alloca when the source is too small and memcpy across. This should preserve the compile-time fast-isel benefits of doing gep+load sequences and avoiding FCAs. Reviewed by Benjamin and Evgeniy (who fixed PR11905). llvm-svn: 165615
* Remove the final bits of Attributes being declared in the AttributeBill Wendling2012-10-101-44/+57
| | | | | | | namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165611
* Move TargetData to DataLayout.Micah Villmow2012-10-081-11/+11
| | | | llvm-svn: 165395
* Update for encapsulating the "construct*AlignmentFromInt" methods.Bill Wendling2012-09-211-1/+1
| | | | llvm-svn: 164374
* In ARC, if we're emitting assembly markers for calls toJohn McCall2012-09-071-6/+17
| | | | | | | | | objc_retainAutoreleasedReturnValue, we need to also be killing them during return peepholing. Make sure we recognize an intervening bitcast, but more importantly, assert if we can't find the asm marker at all. rdar://problem/12133032 llvm-svn: 163431
* Handle functions with struct arguments or return types and the regparmRafael Espindola2012-07-311-20/+16
| | | | | | | | | | | | | | attribute. It is a variation of the x86_64 ABI: * A struct returned indirectly uses the first register argument to pass the pointer. * Floats, Doubles and structs containing only one of them are not passed in registers. * Other structs are split into registers if they fit on the remaining ones. Otherwise they are passed in memory. * When a struct doesn't fit it still consumes the registers. llvm-svn: 161022
* Don't crash *or* insert a bogus autorelease when emitting aJohn McCall2012-07-311-1/+2
| | | | | | this-adjustment thunk in ARC++. llvm-svn: 161014
* [Windows] Use thiscall as the default calling convention for class methods. ↵Timur Iskhodzhanov2012-07-121-6/+11
| | | | | | PR12785 llvm-svn: 160121
OpenPOWER on IntegriCloud