summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Revert r126794.Devang Patel2011-03-021-1/+1
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-1/+1
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* Add some helper methods that will be used in my next patch.Chris Lattner2011-02-281-0/+10
| | | | llvm-svn: 126596
* Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner2011-02-271-4/+3
| | | | | | a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-4/+9
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-221-1/+44
| | | | llvm-svn: 126189
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-201-1/+0
| | | | llvm-svn: 126062
* Objective-c armv7 API for atomic properties of Fariborz Jahanian2011-02-181-0/+4
| | | | | | scalar types. // rdar://7761305 llvm-svn: 125946
* Remove the "conditional save" hashtables from IR generation.John McCall2011-02-171-7/+0
| | | | llvm-svn: 125761
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-15/+118
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-5/+6
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-0/+40
| | | | llvm-svn: 125661
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-2/+1
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
* Assorted cleanup:John McCall2011-02-151-7/+1
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
* Implement mcount profiling, enabled via -pg.Roman Divacky2011-02-101-0/+3
| | | | llvm-svn: 125282
* If an aggregate argument is passed indirectly because it has non trivialDevang Patel2011-02-091-1/+2
| | | | | | | | destructor or copy constructor than let debug info know about it. Radar 8945514. llvm-svn: 125142
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-80/+32
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-26/+64
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Clean up of -fapple-kext abi code. No change otherwise.Fariborz Jahanian2011-02-031-2/+1
| | | | llvm-svn: 124807
* -fapple-kext support for indirect call to virtuals dtors - wip.Fariborz Jahanian2011-02-011-0/+4
| | | | llvm-svn: 124701
OpenPOWER on IntegriCloud