summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-7/+4
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* Move all the significant __block code into CGBlocks.cpp. No functionalityJohn McCall2011-03-311-0/+5
| | | | | | change. llvm-svn: 128608
* Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) toKen Dyck2011-03-231-2/+2
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128129
* Use a slightly more semantic interface for emitting call arguments.John McCall2011-03-111-9/+5
| | | | llvm-svn: 127494
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-4/+7
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Extract a function to emit an arbitrary expression as if it were the initializerJohn McCall2011-03-081-1/+7
| | | | | | for a local variable. llvm-svn: 127227
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-1/+9
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-1/+1
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-2/+1
| | | | | | This reverts commit 126863. llvm-svn: 126886
* revert r126858.Devang Patel2011-03-021-1/+1
| | | | llvm-svn: 126874
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-1/+2
| | | | llvm-svn: 126863
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-1/+1
| | | | | | | | | | in order. This fixes few blocks.exp regressions. Reapply r126795 with a fix (one character change) for gdb testsuite regressions. llvm-svn: 126858
OpenPOWER on IntegriCloud