summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-131-37/+32
| | | | | | them, too. llvm-svn: 135038
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-10/+11
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-12/+27
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-111-67/+168
| | | | | | | | | | | - 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
* More compiler workarounds. I have to admit that I was notJohn McCall2011-07-091-4/+14
| | | | | | | | expecting so much concentrated oddity on what seemed like a trivial feature. Thanks to François Pichet for doing the MSVC legwork here. llvm-svn: 134813
* GCC 4.2 compatibility hack.John McCall2011-07-091-3/+4
| | | | llvm-svn: 134785
* A number of array-related IR-gen cleanups.John McCall2011-07-091-56/+214
| | | | | | | | | | | | - 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
* Don't zero-initialize default-initialized local variables that haveDouglas Gregor2011-07-011-1/+18
| | | | | | | | trivial default constructors. This generated-code regression was caused by r131796, which had simplified the handling of default initialization in Sema. Fixes <rdar://problem/9694300>. llvm-svn: 134260
* objc-arc: fix a IRGen crash when checking forFariborz Jahanian2011-06-291-1/+2
| | | | | | | accessibility of an initializer which is a compound statement. // rdar://9694706 llvm-svn: 134091
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-7/+8
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Honor objc_precise_lifetime in GC mode by feeding the valueJohn McCall2011-06-241-0/+20
| | | | | | | 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-15/+13
| | | | | | | 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
* Remove dead variables.Benjamin Kramer2011-06-181-1/+0
| | | | llvm-svn: 133346
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-171-4/+38
| | | | | | | | | | | | 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-37/+41
| | | | llvm-svn: 133144
* Suppress a warning in -Asserts builds.John McCall2011-06-151-0/+1
| | | | llvm-svn: 133110
* Automatic Reference Counting.John McCall2011-06-151-16/+240
| | | | | | | | | | 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
* Do not emit stoppoint before emitting debug info for parameters.Devang Patel2011-06-151-3/+1
| | | | | | | - llvm.dbg.declare already receives line number information from ParmDecl - Additional extra stoppoint messes up gdb's understanding of where function body starts. llvm-svn: 133065
* Rework r132576.Devang Patel2011-06-041-2/+0
| | | | | | Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132610
* Emit debug info only if there is an insertion point. The debug info should ↵Devang Patel2011-06-031-9/+10
| | | | | | not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132576
* Add unnamed_addr to internal globals which are only used as an operand to ↵Eli Friedman2011-05-271-0/+1
| | | | | | memcpy. (Spotted by looking at IR.) llvm-svn: 132226
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+1
| | | | llvm-svn: 130953
* Simplify code a bit by using CallArgList::add. No intended functionality ↵Eli Friedman2011-05-021-2/+2
| | | | | | change. llvm-svn: 130699
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-2/+3
| | | | llvm-svn: 129567
* Fix typo.Devang Patel2011-04-051-1/+1
| | | | llvm-svn: 128921
* Move all the significant __block code into CGBlocks.cpp. No functionalityJohn McCall2011-03-311-187/+7
| | | | | | change. llvm-svn: 128608
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-4/+7
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Extract a function to emit an arbitrary expression as if it were the initializerJohn McCall2011-03-081-53/+77
| | | | | | for a local variable. llvm-svn: 127227
* Revert r126422 "Use private linkage to avoid symbol conflicts inDouglas Gregor2011-03-061-1/+1
| | | | | | corner cases like the one in PR9301." which caused PR9416. llvm-svn: 127136
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-2/+3
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* revert r126858.Devang Patel2011-03-021-3/+2
| | | | llvm-svn: 126874
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-2/+3
| | | | | | | | | | 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-3/+2
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-2/+3
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* Use private linkage to avoid symbol conflicts in corner cases like the oneRafael Espindola2011-02-241-1/+1
| | | | | | in PR9301. llvm-svn: 126422
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-1/+18
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-2/+6
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-221-147/+214
| | | | llvm-svn: 126189
* The flags we're supposed to write into a byref struct are *not* theJohn McCall2011-02-181-12/+13
| | | | | | | | | | | | _Block_object_* flags; it's just BLOCK_HAS_COPY_DISPOSE or not. Also, we don't need to chase forwarding pointers prior to calling _Block_object_dispose; _Block_object_dispose in fact already does this. rdar://problem/9006315 llvm-svn: 125823
* implement basic support for __label__. I wouldn't be shocked if there areChris Lattner2011-02-181-1/+1
| | | | | | | | | bugs from other clients that don't expect to see a LabelDecl in a DeclStmt, but if so they should be easy to fix. This implements most of PR3429 and rdar://8287027 llvm-svn: 125817
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Ensure that the NRVO flag has some block to insert into. Fixes PR9178!Nick Lewycky2011-02-161-1/+2
| | | | llvm-svn: 125694
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-3/+2
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
* Assorted cleanup:John McCall2011-02-151-3/+3
| | | | | | | | | - 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
* If an aggregate argument is passed indirectly because it has non trivialDevang Patel2011-02-091-2/+3
| | | | | | | | 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-31/+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-4/+3
| | | | | | | | | | | | | | | | | - 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
* Convert the exception-freeing cleanup over to the conditional cleanups code,John McCall2011-01-281-0/+1
| | | | | | | | | fixing a crash which probably nobody was ever going to see. In doing so, fix a horrendous number of problems with the conditional-cleanups code. Also, make conditional cleanups re-use the cleanup's activation variable, which avoids some unfortunate repetitiveness. llvm-svn: 124481
* Fixes an IRgen bug where __block variable isFariborz Jahanian2011-01-261-3/+27
| | | | | | | referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
* Replace calls to CharUnits::fromQuantity() with ones to Ken Dyck2011-01-181-2/+2
| | | | | | ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units. llvm-svn: 123720
OpenPOWER on IntegriCloud