summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy ↵Eli Friedman2011-12-051-1/+2
| | | | | | | | | | | pass in the correct alignment when known. The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment. <rdar://problem/10463337> llvm-svn: 145862
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-6/+5
| | | | | | change.) llvm-svn: 145753
* Switch the Alignment argument on AggValueSlot over to CharUnits, per John's ↵Eli Friedman2011-12-031-1/+1
| | | | | | review comment. llvm-svn: 145741
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-031-1/+3
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* When destroying temporaries, instead of a custom cleanup use thePeter Collingbourne2011-11-271-1/+2
| | | | | | | | | | | generic pushDestroy function. This would reduce the number of useful declarations in CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary does not deserve its own file, move it to CGCleanup.cpp and delete CGTemporaries.cpp. llvm-svn: 145202
* Fix a bunch of really nasty bugs in how we compute alignment for reference ↵Eli Friedman2011-11-161-0/+9
| | | | | | lvalues. PR11376. llvm-svn: 144745
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-6/+24
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-3/+12
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Bind function "r-values" as l-values when emitting them asJohn McCall2011-11-081-1/+8
| | | | | | opaque values. Silly C type system. llvm-svn: 144144
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-071-4/+0
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-54/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Annotate imprecise FP division with fpaccuracy metadataPeter Collingbourne2011-10-271-0/+5
| | | | | | | | | The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136
* Add a new subclass of RunCleanupScopes that also handles creating newEric Christopher2011-10-191-3/+41
| | | | | | lexical blocks for debug info. llvm-svn: 142466
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+2
| | | | llvm-svn: 141632
* CUDA: IR generation support for kernel call expressionsPeter Collingbourne2011-10-061-0/+3
| | | | llvm-svn: 141300
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-041-1/+2
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* When performing an @throw in ARC, retain + autoreleaseJohn McCall2011-10-011-0/+2
| | | | | | | the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 llvm-svn: 140945
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-6/+6
| | | | | | | | | | | | | This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049
* Refactor the load of the exception pointer and the exception selector from theirBill Wendling2011-09-151-0/+5
| | | | | | storage slot into helper functions. llvm-svn: 139826
* Rewrite this loop to use partial destruction; I'm not sure it'sJohn McCall2011-09-151-2/+2
| | | | | | | | possible for that to matter right now, but eventually I think we'll need to unify this better, and then it might. Also, use a more efficient looping structure. llvm-svn: 139788
* Unify the decision of how to emit property getters and setters into aJohn McCall2011-09-131-0/+2
| | | | | | | | single code path. Use atomic loads and stores where necessary. Load and store anything of the appropriate size and alignment with primitive operations instead of going through the call. llvm-svn: 139580
* Privatize the setter/getter call generation methods, plus some minorJohn McCall2011-09-121-3/+0
| | | | | | modernization. No functionality change. llvm-svn: 139555
* Simplify the generation of Objective-C setters, at least a little.John McCall2011-09-101-0/+2
| | | | | | | | | Use a more portable heuristic for deciding when to emit a single atomic store; it's possible that I've lost information here, but I'm not sure how much of the logic before was intentionally arch-specific and how much was just not quite consistent. llvm-svn: 139468
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+17
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-1/+2
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-1/+2
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-65/+23
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-1/+1
| | | | | | Mulder! llvm-svn: 135855
* add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner2011-07-201-6/+6
| | | | llvm-svn: 135577
* now that we have a centralized place to do so, add some using declarations forChris Lattner2011-07-201-8/+8
| | | | | | | some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. llvm-svn: 135576
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-10/+10
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-2/+4
| | | | llvm-svn: 135265
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-131-1/+1
| | | | | | them, too. llvm-svn: 135038
* Aggressive dead code elimination.John McCall2011-07-131-8/+0
| | | | llvm-svn: 135029
* Generalize the routine for destroying an object with staticJohn McCall2011-07-131-4/+4
| | | | | | | storage duration, then explicitly exempt ownership-qualified types from it. llvm-svn: 135028
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-9/+35
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-19/+54
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* insert a bitcast in the 'expand' case of argument passing when needed. ThisChris Lattner2011-07-121-1/+2
| | | | | | fixes the -m32 build of oggenc. llvm-svn: 134971
* Do full-expression cleanups in a much more sensible way that still letsJohn McCall2011-07-121-54/+15
| | | | | | people write useful cleanup classes. llvm-svn: 134942
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-111-7/+13
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-3/+3
| | | | llvm-svn: 134831
* A number of array-related IR-gen cleanups.John McCall2011-07-091-0/+56
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-9/+18
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Honor objc_precise_lifetime in GC mode by feeding the valueJohn McCall2011-06-241-0/+4
| | | | | | | in the variable to an inline asm which gets run when the variable goes out of scope. llvm-svn: 133840
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-8/+10
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* When binding a reference to an Automatic Reference Counting temporary,Douglas Gregor2011-06-221-2/+55
| | | | | | | | | retain/release the temporary object appropriately. Previously, we would only perform the retain/release operations when the reference would extend the lifetime of the temporary, but this does the wrong thing across calls. llvm-svn: 133620
* Emit @finally blocks completely lazily instead of forcing theirJohn McCall2011-06-221-9/+21
| | | | | | | | | | | | | existence by always threading an edge from the catchall. Not doing this was previously causing a crash in the very extreme case where neither the normal cleanup nor the EH catchall was actually reachable: we would delete the catchall entry block, which would cause us to delete the entry block of the finally cleanup as well because the cleanup logic would merge the blocks, which in turn triggered an assert because later blocks in the finally would still be using values from the entry. Laziness turns out to be the most elegant solution to the problem. llvm-svn: 133601
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-171-0/+1
| | | | | | | | | | | | they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
* Restore correct use of GC barriers.John McCall2011-06-161-4/+4
| | | | llvm-svn: 133144
OpenPOWER on IntegriCloud