summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Automatic Reference Counting.John McCall2011-06-151-4/+79
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-4/+10
| | | | | | It's quite likely that this will explode, but I need to know how. :) llvm-svn: 132269
* Back out r132209; it's breaking nightly tests.Eli Friedman2011-05-271-1/+0
| | | | llvm-svn: 132219
* Implement a new, much improved version of the cleanup hack. We just needJohn McCall2011-05-271-0/+1
| | | | | | | | to be careful to emit landing pads that are always prepared to handle a cleanup path. This is correct mostly because of the fix to the LLVM inliner, r132200. llvm-svn: 132209
* Fix location of setter/getter synthesized for a property.Devang Patel2011-05-191-1/+2
| | | | llvm-svn: 131701
* Make CGF.getContext() inlinable, because it's trivial, and optimizeJohn McCall2011-05-151-1/+1
| | | | | | hasAggregateLLVMType. llvm-svn: 131375
* Move code to emit the callee of an CXXOperatorCallExpr out into a separate ↵Anders Carlsson2011-05-081-0/+3
| | | | | | function in CGClass.cpp llvm-svn: 131075
* Add an implementation of thunks for varargs methods. The implementation is ↵Eli Friedman2011-05-061-0/+3
| | | | | | a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 . llvm-svn: 130993
* Fully implement delegating constructors!Alexis Hunt2011-05-011-0/+6
| | | | | | | | | | As far as I know, this implementation is complete but might be missing a few optimizations. Exceptions and virtual bases are handled correctly. Because I'm an optimist, the web page has appropriately been updated. If I'm wrong, feel free to downgrade its support categories. llvm-svn: 130642
* implement rdar://9289524 - case followed immediately by break results in ↵Chris Lattner2011-04-171-0/+5
| | | | | | | | empty IR block, a -O0 code quality issue. llvm-svn: 129652
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-0/+2
| | | | | | draft standard (N3291). llvm-svn: 129541
OpenPOWER on IntegriCloud