summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Distinguish more carefully between free functions and C++ instance methodsJohn McCall2012-07-071-50/+96
| | | | | | | | in the ABI arrangement, and leave a hook behind so that we can easily tweak CCs on platforms that use different CCs by default for C++ instance methods. llvm-svn: 159894
* revert CodeGen support for the alloc_size attribute until we finish the ↵Nuno Lopes2012-06-221-19/+0
| | | | | | design of a more generic metadata node llvm-svn: 159016
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-8/+7
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* adjust to mainline llvm API change.Chris Lattner2012-05-281-2/+1
| | | | llvm-svn: 157557
* fix codegen support for alloc_size attribute for static C++ methodsNuno Lopes2012-05-251-2/+4
| | | | | | add test case for C++ codegen llvm-svn: 157500
* add CodeGen support for the alloc_size attributeNuno Lopes2012-05-251-0/+17
| | | | llvm-svn: 157483
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-8/+8
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-11/+10
| | | | llvm-svn: 154789
* Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov2012-04-131-33/+90
| | | | | | | - Handle unions - Handle C++ classes llvm-svn: 154664
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-2/+1
| | | | | | testers. llvm-svn: 153660
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-1/+2
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* When "low alignment" is specified, then set the alignment of the aggregate'sBill Wendling2012-03-161-1/+3
| | | | | | | | | | store to 1. This allows code-gen to select a more appropriate alignment. If left to zero, an alignment greater than the alignment of the pointer may be selected, causing code-gen to use instructions which require an alignment greater than the pointer guarantees. <rdar://problem/11043589> llvm-svn: 152951
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-5/+5
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-126/+221
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Teach clang to add metadata tags to calls and invokes in ObjC withDan Gohman2012-02-161-6/+29
| | | | | | | | | -fno-objc-arc-exceptions. This will allow the optimizer to perform optimizations which are only safe under that flag. This is a part of rdar://10803830. llvm-svn: 150644
* Fix function prolog codegen whe coerce-to type is a struct.Evgeniy Stepanov2012-02-101-9/+30
| | | | | | | | | | This changes function prolog in such a way as to avoid out-of-bounds stack store in the case when coerce-to type has a larger storage size than the real argument type. Fixes PR11905. llvm-svn: 150238
* When emitting an ARC epilogue that looks like a return of 'self',John McCall2012-01-291-0/+56
| | | | | | | | kill the retain from the return site. This has the workaround nature. It's badness all around. llvm-svn: 149193
* Get a little bit smarter about killing off the ReturnValue allocaJohn McCall2012-01-291-10/+45
| | | | | | | in the presence of straight-line cleanups. This is a simple but important case, particularly for ARC. llvm-svn: 149190
* use llvm:Attributes instead of unsignedKostya Serebryany2012-01-201-10/+10
| | | | llvm-svn: 148554
* Move the piece of code up that skips the padding argument. Without this change,Akira Hatanaka2012-01-091-4/+4
| | | | | | padding insertion will not work if the coerced type is not a structure. llvm-svn: 147786
* Add field PaddingType to ABIArgInfo which specifies the type of padding thatAkira Hatanaka2012-01-071-0/+16
| | | | | | | | is inserted before the real argument. Padding is needed to ensure the backend reads from or writes to the correct argument slots when the original alignment of a byval structure is unavailable due to flattening. llvm-svn: 147699
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-2/+3
| | | | | | change.) llvm-svn: 145753
* Add a utility to get a RValue for a given LValue for an aggregate; switch a ↵Eli Friedman2011-12-031-4/+3
| | | | | | few places over to it. llvm-svn: 145747
* Add inreg attributes to reference arguments.Rafael Espindola2011-11-271-1/+2
| | | | llvm-svn: 145189
* Fix crash in calling convention code expanding an struct with a complex member.Eli Friedman2011-11-151-3/+9
| | | | llvm-svn: 144612
* Fix alignment on alloca's for parameters using ABIArgInfo::Expand. Eli Friedman2011-11-031-4/+5
| | | | llvm-svn: 143658
* In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson2011-10-311-0/+11
| | | | | | double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350
* Fix a typo that completely broke the expansion of complex arguments.Bob Wilson2011-10-221-1/+1
| | | | llvm-svn: 142734
* Add returns_twice to functions that are known to return twice. This implementsRafael Espindola2011-10-121-0/+2
| | | | | | the same behavior of gcc by keeping the attribute out of the function type. llvm-svn: 141803
* Propagate __attribute__((returns_twice)) from C to IL.Rafael Espindola2011-10-031-0/+3
| | | | llvm-svn: 141002
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-1/+1
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
OpenPOWER on IntegriCloud