aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/DebugInfo/array.ll
AgeCommit message (Collapse)AuthorFilesLines
2014-12-15IR: Make metadata typeless in assemblyDuncan P. N. Exon Smith1-18/+18
Now that `Metadata` is typeless, reflect that in the assembly. These are the matching assembly changes for the metadata/value split in r223802. - Only use the `metadata` type when referencing metadata from a call intrinsic -- i.e., only when it's used as a `Value`. - Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode` when referencing it from call intrinsics. So, assembly like this: define @foo(i32 %v) { call void @llvm.foo(metadata !{i32 %v}, metadata !0) call void @llvm.foo(metadata !{i32 7}, metadata !0) call void @llvm.foo(metadata !1, metadata !0) call void @llvm.foo(metadata !3, metadata !0) call void @llvm.foo(metadata !{metadata !3}, metadata !0) ret void, !bar !2 } !0 = metadata !{metadata !2} !1 = metadata !{i32* @global} !2 = metadata !{metadata !3} !3 = metadata !{} turns into this: define @foo(i32 %v) { call void @llvm.foo(metadata i32 %v, metadata !0) call void @llvm.foo(metadata i32 7, metadata !0) call void @llvm.foo(metadata i32* @global, metadata !0) call void @llvm.foo(metadata !3, metadata !0) call void @llvm.foo(metadata !{!3}, metadata !0) ret void, !bar !2 } !0 = !{!2} !1 = !{i32* @global} !2 = !{!3} !3 = !{} I wrote an upgrade script that handled almost all of the tests in llvm and many of the tests in cfe (even handling many `CHECK` lines). I've attached it (or will attach it in a moment if you're speedy) to PR21532 to help everyone update their out-of-tree testcases. This is part of PR21532. llvm-svn: 224257
2014-10-03Revert "Revert "DI: Fold constant arguments into a single MDString""Duncan P. N. Exon Smith1-11/+11
This reverts commit r218918, effectively reapplying r218914 after fixing an Ocaml bindings test and an Asan crash. The root cause of the latter was a tightened-up check in `DILexicalBlock::Verify()`, so I'll file a PR to investigate who requires the loose check (and why). Original commit message follows. -- This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 219010
2014-10-02Revert "DI: Fold constant arguments into a single MDString"Duncan P. N. Exon Smith1-11/+11
This reverts commit r218914 while I investigate some bots. llvm-svn: 218918
2014-10-02DI: Fold constant arguments into a single MDStringDuncan P. N. Exon Smith1-11/+11
This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 218914
2014-10-01Move the complex address expression out of DIVariable and into an extraAdrian Prantl1-2/+2
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics. Previously, DIVariable was a variable-length field that has an optional reference to a Metadata array consisting of a variable number of complex address expressions. In the case of OpPiece expressions this is wasting a lot of storage in IR, because when an aggregate type is, e.g., SROA'd into all of its n individual members, the IR will contain n copies of the DIVariable, all alike, only differing in the complex address reference at the end. By making the complex address into an extra argument of the dbg.value/dbg.declare intrinsics, all of the pieces can reference the same variable and the complex address expressions can be uniqued across the CU, too. Down the road, this will allow us to move other flags, such as "indirection" out of the DIVariable, too. The new intrinsics look like this: declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr) declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr) This patch adds a new LLVM-local tag to DIExpressions, so we can detect and pretty-print DIExpression metadata nodes. What this patch doesn't do: This patch does not touch the "Indirect" field in DIVariable; but moving that into the expression would be a natural next step. http://reviews.llvm.org/D4919 rdar://problem/17994491 Thanks to dblaikie and dexonsmith for reviewing this patch! Note: I accidentally committed a bogus older version of this patch previously. llvm-svn: 218787
2014-10-01Revert r218778 while investigating buldbot breakage.Adrian Prantl1-2/+2
"Move the complex address expression out of DIVariable and into an extra" llvm-svn: 218782
2014-10-01Move the complex address expression out of DIVariable and into an extraAdrian Prantl1-2/+2
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics. Previously, DIVariable was a variable-length field that has an optional reference to a Metadata array consisting of a variable number of complex address expressions. In the case of OpPiece expressions this is wasting a lot of storage in IR, because when an aggregate type is, e.g., SROA'd into all of its n individual members, the IR will contain n copies of the DIVariable, all alike, only differing in the complex address reference at the end. By making the complex address into an extra argument of the dbg.value/dbg.declare intrinsics, all of the pieces can reference the same variable and the complex address expressions can be uniqued across the CU, too. Down the road, this will allow us to move other flags, such as "indirection" out of the DIVariable, too. The new intrinsics look like this: declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr) declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr) This patch adds a new LLVM-local tag to DIExpressions, so we can detect and pretty-print DIExpression metadata nodes. What this patch doesn't do: This patch does not touch the "Indirect" field in DIVariable; but moving that into the expression would be a natural next step. http://reviews.llvm.org/D4919 rdar://problem/17994491 Thanks to dblaikie and dexonsmith for reviewing this patch! llvm-svn: 218778
2014-01-30Reland r200340 - 'Add line table debug info to COFF files when using a win32 ↵Timur Iskhodzhanov1-1/+1
triple' This incorporates a couple of fixes reviewed at http://llvm-reviews.chandlerc.com/D2651 llvm-svn: 200440
2013-11-22Debug Info: update testing cases to specify the debug info version number.Manman Ren1-0/+2
We are going to drop debug info without a version number or with a different version number, to make sure we don't crash when we see bitcode files with different debug info metadata format. llvm-svn: 195504
2013-09-06Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.Manman Ren1-3/+3
Field 2 of DIType (Context), field 9 of DIDerivedType (TypeDerivedFrom), field 12 of DICompositeType (ContainingType), fields 2, 7, 12 of DISubprogram (Context, Type, ContainingType). llvm-svn: 190205
2013-08-26Debug Info: add an identifier field to DICompositeType.Manman Ren1-2/+2
DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. llvm-svn: 189282
2013-07-26Debug Info Verifier: enable verification of DICompileUnit.Manman Ren1-1/+2
We used to call Verify before adding DICompileUnit to the list, and now we remove the check and always add DICompileUnit to the list in DebugInfoFinder, so we can verify them later on. llvm-svn: 187237
2013-07-25Debug Info: improve the verifier to check field types.Manman Ren1-5/+5
Make sure the context and type fields are MDNodes. We will generate verification errors if those fields are non-empty strings. Fix testing cases to make them pass the verifier. llvm-svn: 187106
2013-04-22Revert "Revert "PR14606: debug info imported_module support""David Blaikie1-1/+1
This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even though the debug info was clearly invalid on all of them, but this ought to fix it. llvm-svn: 179996
2013-04-19Revert "PR14606: debug info imported_module support"Eric Christopher1-1/+1
This reverts commit r179836 as it seems to have caused test failures. llvm-svn: 179840
2013-04-19PR14606: debug info imported_module supportDavid Blaikie1-1/+1
Adding another CU-wide list, in this case of imported_modules (since they should be relatively rare, it seemed better to add a list where each element had a "context" value, rather than add a (usually empty) list to every scope). This takes care of DW_TAG_imported_module, but to fully address PR14606 we'll need to expand this to cover DW_TAG_imported_declaration too. llvm-svn: 179836
2013-03-28Revert "Adding DIImportedModules to DIScopes."David Blaikie1-7/+7
This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. llvm-svn: 178215
2013-03-27Adding DIImportedModules to DIScopes.David Blaikie1-7/+7
This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. llvm-svn: 178099
2013-03-22Reorder the DIFile field in DILexicalBlock to become a prefix common with ↵David Blaikie1-1/+1
other DIScopes llvm-svn: 177703
2013-03-21Remove unused field in DISubprogramDavid Blaikie1-1/+1
llvm-svn: 177661
2013-03-20Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the ↵David Blaikie1-1/+1
common DIScope prefix llvm-svn: 177595
2013-03-20Remove unused field in DICompileUnitDavid Blaikie1-1/+1
llvm-svn: 177590
2013-03-17Split out filename & directory from DIFile to start generalizing over DIScopesDavid Blaikie1-2/+3
This is the first step to making all DIScopes have a common metadata prefix (so that things (using directives, for example) that can appear in any scope can be added to that common prefix). DIFile is itself a DIScope so the common prefix of all DIScopes cannot be a DIFile - instead it's the raw filename/directory name pair. llvm-svn: 177239
2013-03-13Refactor filename/directory in DICompileUnit into a DIFileDavid Blaikie1-1/+1
This is the next step towards making the metadata for DIScopes have a common prefix rather than having to delegate based on their tag type. llvm-svn: 176913
2013-03-12Remove unused "isMain" field from DICompileUnitDavid Blaikie1-1/+1
llvm-svn: 176910
2013-03-11Upgrading debug info test cases to be (more) compatible with the current ↵David Blaikie1-1/+1
debug info format. These cases were found by further work to remove support for debug info versioning. Common cleanups (other than changing the version info in the tag field) included adding the last parameter to compile_units (recently added for fission support) and other cases of trailing fields in lexical blocks, compile units, and subprograms. llvm-svn: 176834
2013-03-08Upgrade tests to the latest debug info format.David Blaikie1-10/+11
Mostly this is just changing the named metadata (llvm.dbg.sp, llvm.dbg.gv, llvm.dbg.<func>.lv, etc -> llvm.dbg.cu), adding a few fields to older records (DIVariable: flags/inlined-at, DICompileUnit: sp/gv/types, DISubprogram: local variables list) The tests to update were discovered by a change I'm working on to remove debug info version support - so any tests using old debug info versions I haven't updated probably are bad tests or just not actually designed to test debug info. llvm-svn: 176671
2012-12-04Use the 'count' attribute to calculate the upper bound of an array.Bill Wendling1-1/+1
The count attribute is more accurate with regards to the size of an array. It also obviates the upper bound attribute in the subrange. We can also better handle an unbound array by setting the count to -1 instead of the lower bound to 1 and upper bound to 0. llvm-svn: 169312
2012-12-04Add a 'count' field to the DWARF subrange.Bill Wendling1-1/+1
The count field is necessary because there isn't a difference between the 'lo' and 'hi' attributes for a one-element array and a zero-element array. When the count is '0', we know that this is a zero-element array. When it's >=1, then it's a normal constant sized array. When it's -1, then the array is unbounded. llvm-svn: 169218
2011-04-08Add radar number for future reference.Devang Patel1-1/+1
llvm-svn: 129172
2011-04-08Do not emit DW_AT_upper_bound and DW_AT_lower_bound for unbouded array.Devang Patel1-0/+34
If lower bound is more then upper bound then consider it is an unbounded array. An array is unbounded if non-zero lower bound is same as upper bound. If lower bound and upper bound are zero than array has one element. llvm-svn: 129156