summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/debug-info-block-captured-self.m
Commit message (Collapse)AuthorAgeFilesLines
* Simplify codegen and debug info generation for block context parameters.Adrian Prantl2017-10-261-72/+0
| | | | | | | | | | | | | | | | | | | | The exisiting code goes out of its way to put block parameters into an alloca only at -O0, and then describes the funciton argument with a dbg.declare, which is undocumented in the LLVM-CFE contract and does not actually behave as intended after LLVM r642022. This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value). This reapplies r316684 with some dead code removed. rdar://problem/35043980 Differential Revision: https://reviews.llvm.org/D39305 llvm-svn: 316689
* Revert "Simplify codegen and debug info generation for block context ↵Adrian Prantl2017-10-261-0/+72
| | | | | | | | parameters." This reverts commit r316684 while investigating buildbot breakage. llvm-svn: 316686
* Simplify codegen and debug info generation for block context parameters.Adrian Prantl2017-10-261-72/+0
| | | | | | | | | | | | | | | | | | The exisiting code goes out of its way to put block parameters into an alloca only at -O0, and then describes the funciton argument with a dbg.declare, which is undocumented in the LLVM-CFE contract and does not actually behave as intended after LLVM r642022. This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value). rdar://problem/35043980 Differential Revision: https://reviews.llvm.org/D39305 llvm-svn: 316684
* Adopt to LLVM API change (llvm.dbg.value no longer has an offset)Adrian Prantl2017-07-281-1/+1
| | | | llvm-svn: 309427
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-1/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* DI: Update testcases for LLVM assembly changeDuncan P. N. Exon Smith2015-07-311-2/+3
| | | | | | | | | | Update testcases after LLVM change r243774. Most of these had no need to check `tag:` field, but did so as a way of getting to the `name:` field. In a few cases I've converted the `tag:` checks to `arg:` or `CHECK-NOT: arg:`. llvm-svn: 243775
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-4/+4
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
* DebugInfo: Move new hierarchy into place (clang)Duncan P. N. Exon Smith2015-03-031-4/+6
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-1/+1
| | | | llvm-svn: 230795
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-151-5/+5
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* Revert "Revert "DI: LLVM schema change: fold constants into string""Duncan P. N. Exon Smith2014-10-031-1/+1
| | | | | | | | | | | | | | This reverts commit r218917, effectively reapplying r218913. Original commit message follows. -- Update debug info testcases for an LLVM metadata schema change to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 219011
* Revert "DI: LLVM schema change: fold constants into string"Duncan P. N. Exon Smith2014-10-021-1/+1
| | | | | | This reverts commit r218913 while I investigate some bots. llvm-svn: 218917
* DI: LLVM schema change: fold constants into stringDuncan P. N. Exon Smith2014-10-021-1/+1
| | | | | | | | | Update debug info testcases for an LLVM metadata schema change to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 218913
* Update CGDebugInfo to the updated API in LLVM.Adrian Prantl2014-10-011-3/+3
| | | | | | | | | | Complex address expressions are no longer part of DIVariable, but rather an extra argument to the debug intrinsics. http://reviews.llvm.org/D4919 rdar://problem/17994491 llvm-svn: 218788
* Reverting r218777 while investigating buildbot breakage.Adrian Prantl2014-10-011-3/+3
| | | | | | "Update CGDebugInfo to the updated API in LLVM." llvm-svn: 218781
* Update CGDebugInfo to the updated API in LLVM.Adrian Prantl2014-10-011-3/+3
| | | | | | | | | | Complex address expressions are no longer part of DIVariable, but rather an extra argument to the debug intrinsics. http://reviews.llvm.org/D4919 rdar://problem/17994491 llvm-svn: 218777
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-1/+0
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Bugfix/Followup for r177086.Adrian Prantl2013-03-291-12/+17
| | | | | | | | | * Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 llvm-svn: 178361
* Add a testcase for r177118.Adrian Prantl2013-03-141-1/+2
| | | | llvm-svn: 177124
* Allocate stack storage for .block_descriptor and captured self at -O0.Adrian Prantl2013-03-141-0/+64
This way the register allocator will not optimize away the debug info for captured variables. Fixes rdar://problem/12767564 llvm-svn: 177086
OpenPOWER on IntegriCloud