summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* Use function pointers, rather than references, to pass DestroyersPeter Collingbourne2012-01-261-3/+3
| | | | | | | around, in the process cleaning up the various gcc/msvc compiler workarounds. llvm-svn: 149036
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-141-6/+8
| | | | | | | | | | | | | | | | | | | | APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. llvm-svn: 148178
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-2/+1
| | | | | | change.) llvm-svn: 145753
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-2/+7
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-40/+144
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Emit the copy and dipose helpers for ARC __strongJohn McCall2011-11-091-10/+48
| | | | | | | | | | | | | | | | | | | | block-typed __block variables using objc_retainBlock and objc_dispose. Previously we were using _Block_object_assign and _Block_object_destroy with BLOCK_BYREF_CALLER, which causes the runtime to completely ignore the retain and release. In most cases this doesn't cause catastrophe because the retain/release are balanced and because the block in the variable was copied upon assignment there. However, the stack copy of the variable will be released when it goes out of scope, which is a problem if that value was released due to an assignment to the heap copy. Similarly, a leak can occur if the variable is assigned after the copy to the heap. llvm-svn: 144162
* back out changes in r143399 and r143475.Fariborz Jahanian2011-11-021-15/+9
| | | | | | | rvale-references are captured by reference in blocks. // rdar://9971124. llvm-svn: 143583
* Adds IRGen support for captured rvalue references in blocks.Fariborz Jahanian2011-10-311-11/+19
| | | | | | | In this case, temporary value is copied into block descriptor as their own copy to work on. // rdar://9971124 llvm-svn: 143399
* Recommit:Eric Christopher2011-10-131-1/+1
| | | | | | | | | | | | | | | Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
* Revert file/scope handling patches. gdb testing revealed a couple of bugs.Eric Christopher2011-10-121-1/+1
| | | | llvm-svn: 141796
* Start handling debug line and scope information better:Eric Christopher2011-10-111-1/+1
| | | | | | | | | | | Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 llvm-svn: 141732
* Minor cleanup.Eli Friedman2011-09-301-4/+3
| | | | llvm-svn: 140866
* de-tmpify clang.Benjamin Kramer2011-09-271-3/+3
| | | | llvm-svn: 140637
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-1/+1
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Treat the weak export of block runtime symbols as a deployment-targetJohn McCall2011-09-091-0/+55
| | | | | | | | feature akin to the ARC runtime checks. Removes a terrible hack where IR gen needed to find the declarations of those symbols in the translation unit. llvm-svn: 139404
* switch clang to use the new-new way of creating llvm::StructType's.Chris Lattner2011-08-121-11/+7
| | | | llvm-svn: 137472
* Cleanup; no functionality change.Eli Friedman2011-08-091-5/+1
| | | | llvm-svn: 137126
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-8/+8
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-25/+25
| | | | llvm-svn: 135370
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-1/+1
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Ugh, use this compiler workaround again.John McCall2011-07-121-3/+5
| | | | llvm-svn: 134989
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-7/+10
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-111-9/+9
| | | | llvm-svn: 134893
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-27/+22
| | | | llvm-svn: 134831
* 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
OpenPOWER on IntegriCloud