summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* revert patch for // rdar://9227352Fariborz Jahanian2011-07-061-19/+0
| | | | llvm-svn: 134536
* Use existing -fcatch-undefined-behavior option,Fariborz Jahanian2011-06-291-1/+1
| | | | | | replacing -freset-local-blocks. // rdar://9227352 llvm-svn: 134082
* Under a compiler flag, -freset-local-blocks,Fariborz Jahanian2011-06-281-0/+19
| | | | | | | wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
* Update to match mainline ConstantStruct::get API change. Also, use Chris Lattner2011-06-201-6/+2
| | | | | | | | | | | ConvertType on InitListExprs as they are being converted. This is needed for a forthcoming patch, and improves the IR generated anyway (see additional type names in testcases). This patch also converts a bunch of std::vector's in CGObjCMac to use C arrays. There are a ton more that should be converted as well. llvm-svn: 133413
* update for api change.Chris Lattner2011-06-181-6/+3
| | | | llvm-svn: 133365
* Restore correct use of GC barriers.John McCall2011-06-161-2/+5
| | | | llvm-svn: 133144
* Automatic Reference Counting.John McCall2011-06-151-29/+195
| | | | | | | | | | 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
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-1/+5
| | | | llvm-svn: 132878
* Use arrays and SmallVectors instead of std::vectors when building functionJohn McCall2011-05-151-16/+15
| | | | | | | types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t alias. No functionality change. llvm-svn: 131373
* When determining whether we can make a declaration into a globalDouglas Gregor2011-05-131-18/+1
| | | | | | | constant, also consider whether it's a class type that has any mutable fields. If so, it can't be a global constant. llvm-svn: 131276
* Emit debug info for __destroy_helper_block_ and __copy_helper_block.Devang Patel2011-05-021-0/+8
| | | | llvm-svn: 130719
* Simplify code a bit by using CallArgList::add. No intended functionality ↵Eli Friedman2011-05-021-1/+1
| | | | | | change. llvm-svn: 130699
* Whoops.John McCall2011-03-311-2/+2
| | | | llvm-svn: 128621
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-147/+214
| | | | | | | | | | | | | __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/+203
| | | | | | change. llvm-svn: 128608
* Provide blockDecl's startLoc to startFunction. This fixes hidden bug exposed ↵Devang Patel2011-03-251-1/+1
| | | | | | by recent code gen changes. This is tested by global-blocks-lines.exp in gdb testsuite. llvm-svn: 128303
* Remove a rather egregious use of getFunctionInfo.John McCall2011-03-091-22/+9
| | | | llvm-svn: 127324
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-48/+30
| | | | | | | | | | 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
* Emit block capture initializers as if they were normal initializers for a localJohn McCall2011-03-081-1/+3
| | | | | | variable that just happens to be stored in a wierd place. llvm-svn: 127235
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-0/+4
| | | | llvm-svn: 127225
* CodeGenFunction::GenerateBlockFunction() should initialize DebugInfo just ↵Devang Patel2011-03-071-1/+4
| | | | | | like CodeGenFunction::GenerateCode() llvm-svn: 127174
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-1/+1
| | | | | | 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
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-5/+5
| | | | | | This reverts commit 126863. llvm-svn: 126886
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-5/+5
| | | | llvm-svn: 126863
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-13/+9
| | | | | | | | | | 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
* Reorganize the emission of local variables.John McCall2011-02-221-8/+6
| | | | llvm-svn: 126189
* Don't call objc_read_weak as part of emitting a block literal.John McCall2011-02-161-22/+1
| | | | | | | | Nobody ever gave me a clear reason for why we were doing this, and now it's apparently causing serious problems, so if *not* having this causes problems, we get to solve them the right way this time. llvm-svn: 125627
* Assorted cleanup:John McCall2011-02-151-26/+22
| | | | | | | | | - 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
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-131/+120
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Extend the const capture optimization to C++ record types with noJohn McCall2011-02-081-5/+42
| | | | | | mutable fields and with trivial destructors and copy constructors. llvm-svn: 125073
* When copy-capturing values for a nested capture, use a BlockDeclRefExpr.John McCall2011-02-071-3/+11
| | | | llvm-svn: 125021
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-783/+872
| | | | | | | | | | | | | | | | | - 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
* Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.Ken Dyck2011-01-201-5/+2
| | | | llvm-svn: 123868
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-1/+1
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* Refactor the application of type attributes so that attributes fromJohn McCall2011-01-051-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | the declaration-specifiers and on the declarator itself are moved to the appropriate declarator chunk. This permits a greatly simplified model for how to apply these attributes, as well as allowing a much more efficient query for the GC attribute. Now all qualifier queries follow the same basic strategy of "local qualifiers, local qualifiers on the canonical type, then look through arrays". This can be easily optimized by changing the canonical qualified-array-type representation. Do not process type attributes as decl attributes on declarations with declarators. When computing the type of a block, synthesize a prototype function declarator chunk if the decl-spec type was not a function. This simplifies the logic for building block signatures. Change the logic which inserts an objc_read_weak on a block literal to only fire if the block has a __weak __block variable, rather than if the return type of the block is __weak qualified, which is not actually a sensible thing to ask. llvm-svn: 122871
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-021-59/+59
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-7/+0
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-14/+14
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Fixes synthesis of type for the object which holds info.Fariborz Jahanian2010-11-171-3/+2
| | | | | | about a __block cxx object. llvm-svn: 119411
* Implements __block API for c++ objects. There is stillFariborz Jahanian2010-11-161-5/+38
| | | | | | | issue with runtime which I am discussing it with Blaine. This is wip (so no test yet). llvm-svn: 119368
* Some cleanup of block API code.Fariborz Jahanian2010-11-151-19/+15
| | | | llvm-svn: 119174
* Removed unnecessary initialization of a flag whichFariborz Jahanian2010-11-141-1/+1
| | | | | | | somehow got several block tests fail with a linux built compiler. llvm-svn: 119027
* Initialize couple of fields.Fariborz Jahanian2010-11-131-1/+2
| | | | llvm-svn: 119014
* Block API patch to do copy ctor of copied-in cxx objects inFariborz Jahanian2010-11-131-13/+36
| | | | | | | | copy helper function and dtor of copied cxx objects in dispose helper functions. __block variables TBD next. llvm-svn: 119011
* Adding couple of Block API, a bug fix andFariborz Jahanian2010-11-111-4/+3
| | | | | | a test change, all for blocks. wip. llvm-svn: 118745
* When emitting l-values for bool non-__block decl references, make a pointerJohn McCall2010-10-281-1/+1
| | | | | | | | using the memory type; fixes an assert. Fixes rdar://problem/8605032 llvm-svn: 117610
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-6/+13
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-1/+1
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Fixes an obscure bug in importd block variable layoutFariborz Jahanian2010-09-111-1/+1
| | | | | | | | information when imported variable is used more than once. Originally though to be a bug in importing block varibles. Fixes radar 8417746. llvm-svn: 113675
OpenPOWER on IntegriCloud