summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the updated name for the attribute.Bill Wendling2013-07-221-1/+1
| | | | llvm-svn: 186864
* Use function attributes to pass along the stack protector buffer size ↵Bill Wendling2013-07-121-0/+2
| | | | | | instead of making it a target option. llvm-svn: 186218
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-051-1/+1
| | | | llvm-svn: 185715
* Restore r184205 and associated commits (after commit of r185290)Stephen Lin2013-06-301-27/+8
| | | | | | This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs. llvm-svn: 185291
* [ms-cxxabi] Destroy temporary record arguments in the calleeReid Kleckner2013-06-211-2/+41
| | | | | | | | | | | | | | | | | | Itanium destroys them in the caller at the end of the full expression, but MSVC destroys them in the callee. This is further complicated by the need to emit EH-only destructor cleanups in the caller. This should help clang compile MSVC's debug iterators more correctly. There is still an outstanding issue in PR5064 of a memcpy emitted by the LLVM backend, which is not correct for C++ records. Fixes PR16226. Reviewers: rjmccall Differential Revision: http://llvm-reviews.chandlerc.com/D929 llvm-svn: 184543
* Revert r184205 and associated patches while investigating issue with broken ↵Stephen Lin2013-06-191-8/+27
| | | | | | | | buildbot (possible interaction with LTO) <rdar://problem/14209661> llvm-svn: 184384
* CodeGen: Have 'this'-returning constructors and destructors to take ↵Stephen Lin2013-06-181-27/+8
| | | | | | | | | | advantage of the new backend 'returned' attribute. The backend will now use the generic 'returned' attribute to form tail calls where possible, as well as avoid save-restores of 'this' in some cases (specifically the cases that matter for the ARM C++ ABI). This patch also reverts a prior front-end only partial implementation of these optimizations, since it's no longer required. llvm-svn: 184205
* Simplify: we don't need any special-case lifetime extension when initializingRichard Smith2013-06-121-2/+1
| | | | | | | declarations of reference type; they're handled by the general case handling of MaterializeTemporaryExpr. llvm-svn: 183875
* Fix a FIXME in a testcase about packed structs and calls I left aroundEli Friedman2013-06-111-1/+10
| | | | | | | | | while fixing a related bug. The fix here was simpler than I thought it would be. Fixes <rdar://problem/10530444>. llvm-svn: 183718
* Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.Jakob Stoklund Olesen2013-06-051-2/+23
| | | | | | | | | | | | | | | | Type coercion for argument passing is equivalent to storing the source type and loading the destination type from the same pointer. On big-endian targets, this means that the high bits of integers are preserved. This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian targets by inserting the required shift instructions to preserve the high bits instead of the low bits. This is used by SparcABIInfo when passing small structs in the high bits of registers. llvm-svn: 183291
* Heed ABIArgInfo::getInReg() for return values.Jakob Stoklund Olesen2013-06-051-1/+4
| | | | | | | | The 'inreg' attribute can also be applied to function return values in LLVM IR. The SPARC v9 backend is using the flag when returning structs containing 32-bit floats. llvm-svn: 183290
* Do not reuse the debug location of the return value's store if there is ↵Adrian Prantl2013-05-301-2/+4
| | | | | | | | autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups. rdar://problem/13977888 llvm-svn: 182947
* Fix bad indentation.Jakob Stoklund Olesen2013-05-291-4/+4
| | | | llvm-svn: 182821
* Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko2013-05-051-8/+4
| | | | | | | | constructor from None Patch by Robert Wilhelm. llvm-svn: 181139
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-1/+1
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Ensure that the line table for functions with cleanups is sequential.Adrian Prantl2013-05-021-2/+5
| | | | | | | | | | | | | | | | If there is cleanup code, the cleanup code gets the debug location of the closing '}'. The subsequent ret IR-instruction does not get a debug location. The return _expression_ will get the debug location of the return statement. If the function contains only a single, simple return statement, the cleanup code may become the first breakpoint in the function. In this case we set the debug location for the cleanup code to the location of the return statement. rdar://problem/13442648 llvm-svn: 180932
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-161-5/+4
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* Fix uninitialized read of CalleeWithThisReturn.Manman Ren2013-03-261-1/+1
| | | | | | | | | Initialize CalleeWithThisReturn to 0 in the constructor. Also revert r170815 since checking CalleeWithThisReturn is faster. PR15598 llvm-svn: 178053
* Fix uninitialized read of CalleeWithThisReturn.Evgeniy Stepanov2013-03-261-1/+1
| | | | | | | | | | CalleeWithThisReturn can be left initialized if HasThisReturn() is false. This change reverses the order of checks in EmitFunctionEpilog such that CalleeWithThisReturn is only examined when it has a meaningful value. Found with MemorySanitizer. llvm-svn: 178015
* Under ARC, when we're passing the address of a strong variableJohn McCall2013-03-231-10/+81
| | | | | | | | | | | | to an out-parameter using the indirect-writeback conversion, and we copied the current value of the variable to the temporary, make sure that we register an intrinsic use of that value with the optimizer so that the value won't get released until we have a chance to retain it. rdar://13195034 llvm-svn: 177813
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-201-0/+25
| | | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. Updated from r177211. rdar://12818789 llvm-svn: 177541
* revert r177211 due to its potential issuesManman Ren2013-03-161-12/+0
| | | | llvm-svn: 177222
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-161-0/+12
| | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. rdar://12818789 llvm-svn: 177211
* Have these attriubtes set to 'true' or 'false'.Bill Wendling2013-03-131-52/+16
| | | | | | | | | The back-end cannot differentiate between functions that are from a .ll file and those generated from the front-end. We cannot then take the non-precense of these attributes as a "false" value. Have the front-end explicitly set the value to 'true' or 'false' depending upon what is actually set. llvm-svn: 176985
* Fix indirect byval passing of records in address spaced memory. Allocate ↵Guy Benyei2013-03-101-2/+8
| | | | | | memory on stack, and memcpy the actual value before the call. llvm-svn: 176786
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-071-69/+55
| | | | | | | | | | | | | | | aggregate types in a profoundly wrong way that has to be worked around in every call site, to getEvaluationKind, which classifies and distinguishes between all of these cases. Also, normalize the API for loading and storing complexes. I'm working on a larger patch and wanted to pull these changes out, but it would have be annoying to detangle them from each other. llvm-svn: 176656
* Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of aRichard Smith2013-03-051-1/+4
| | | | | | | | [[noreturn]] function are not required to also be [[noreturn]]. We still emit calls to virtual __attribute__((noreturn)) functions as noreturn; unlike GCC, we do require overriders to also be noreturn for that attribute. llvm-svn: 176476
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-0/+60
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-6/+79
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* 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
OpenPOWER on IntegriCloud