aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/DebugInfo/two-cus-from-same-file.ll
AgeCommit message (Collapse)AuthorFilesLines
2014-12-15IR: Make metadata typeless in assemblyDuncan P. N. Exon Smith1-32/+32
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-18/+18
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-18/+18
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-18/+18
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-3/+3
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-3/+3
"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-3/+3
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-08-06DebugInfo: Assert that any CU for which debug_loc lists are emitted, has at ↵David Blaikie1-2/+2
least one range. This was coming in weird debug info that had variables (and hence debug_locs) but was in GMLT mode (because it was missing the 13th field of the compile_unit metadata) so no ranges were constructed. We should always have at least one range for any CU with a debug_loc in it - because the range should cover the debug_loc. The assertion just ensures that the "!= 1" range case inside the subsequent loop doesn't get entered for the case where there are no ranges at all, which should never reach here in the first place. llvm-svn: 214939
2014-05-14DebugInfo: Sure up subprogram variable list handling with more assertions ↵David Blaikie1-2/+1
and fewer conditionals. Many old tests using prior schemas still had some brokenness here (both indirect arrays and arrays with single bogus elements). Fixed those up so they don't hit the new assertions. Also reduced nesting in some places, etc. llvm-svn: 208817
2014-02-04DebugInfo: Remove some unneeded conditionals now that DIBuilder no longer ↵David Blaikie1-1/+1
emits zero-length arrays as {i32 0} A bunch of test cases needed to be cleaned up for this, many my fault - when implementid imported modules I updated test cases by simply duplicating the prior metadata field - which wasn't always the empty metadata entry. llvm-svn: 200731
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-2/+2
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-25Debug Info: improve the verifier to check field types.Manman Ren1-10/+10
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-2/+2
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-10Add object-emission flag for lit tests. This flag is usedJyotsna Verma1-1/+2
to disable following tests for Hexagon that require direct object generation support. DebugInfo/dwarf-public-names.ll DebugInfo/dwarf-version.ll DebugInfo/member-pointers.ll DebugInfo/namespace.ll DebugInfo/two-cus-from-same-file.ll Fixes bug 15616 - http://llvm.org/bugs/show_bug.cgi?id=15616 llvm-svn: 179209
2013-03-25XFAIL DebugInfo tests for Hexagon.Jyotsna Verma1-0/+1
Hexagon does not support -filetype=obj(direct object generation) flag. Therefore, the following tests are being XFAILed: test/DebugInfo/dwarf-public-names.ll test/DebugInfo/member-pointers.ll test/DebugInfo/two-cus-from-same-file.ll llvm-svn: 177901
2013-03-21Remove unused field in DISubprogramDavid Blaikie1-2/+2
llvm-svn: 177661
2013-03-20Debug info: refactor the first field of DICompileUnit to be a raw ↵David Blaikie1-2/+2
file/directory pair This removes the DICompileUnit special case from DIScope. llvm-svn: 177610
2013-03-20Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the ↵David Blaikie1-2/+2
common DIScope prefix llvm-svn: 177595
2013-03-20Remove unused field in DICompileUnitDavid Blaikie1-2/+2
llvm-svn: 177590
2013-03-17Split out filename & directory from DIFile to start generalizing over DIScopesDavid Blaikie1-1/+2
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-2/+2
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-2/+2
llvm-svn: 176910
2013-03-12Update debug info test cases with empty SplitDebugFilename field.David Blaikie1-2/+2
This could be 'null' or the empty string, DIDescriptor::getStringField coalesces the two cases anyway so it's just a matter of legible/efficient representation. The change in behavior of the DICompileUnit::get* functions could be subsumed by the full verification check - but ideally that should just be an assertion if we could front-load the actual debug info metadata failure paths. llvm-svn: 176907
2013-02-02Remove the (apparently) unnecessary debug info metadata indirection.David Blaikie1-6/+3
The main lists of debug info metadata attached to the compile_unit had an extra layer of metadata nodes they went through for no apparent reason. This patch removes that (& still passes just as much of the GDB 7.5 test suite). If anyone can show evidence as to why these extra metadata nodes are there I'm open to reverting this patch & documenting why they're there. llvm-svn: 174266
2013-01-25Now that llvm-dwarfdump supports flags to specify which DWARF section to dump,Eli Bendersky1-1/+1
use them in tests that run llvm-dwarfdump. This is in order to make tests as specific as possible. llvm-svn: 173498
2012-12-03Simplify this test a bit because DWARF emission/dumping on some platformsEli Bendersky1-6/+4
is not yet good enough for more sophistication. The important goal of this test is to make sure llc doesn't crash on this IR like it used to. llvm-svn: 169146
2012-12-03Fix PR12942: Allow two CUs to be generated from the same source file.Eli Bendersky1-0/+74
Thanks Eric for the review. llvm-svn: 169142