summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker/Inputs
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 18:00:19 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 18:00:19 +0000
commit9738602869dda75509a0f3782cd6639f9e3927c4 (patch)
tree7930467116f656492380f6cef7c78a9f8aa3f1b7 /llvm/test/Linker/Inputs
parent40a34c2e2af8eaabfac246c9801af09a4e478dc1 (diff)
downloadbcm5719-llvm-9738602869dda75509a0f3782cd6639f9e3927c4.tar.gz
bcm5719-llvm-9738602869dda75509a0f3782cd6639f9e3927c4.zip
IR: Enable debug info type ODR uniquing for forward decls
Add a new method, DICompositeType::buildODRType, that will create or mutate the DICompositeType for a given ODR identifier, and use it in LLParser and BitcodeReader instead of DICompositeType::getODRType. The logic is as follows: - If there's no node, create one with the given arguments. - Else, if the current node is a forward declaration and the new arguments would create a definition, mutate the node to match the new arguments. - Else, return the old node. This adds a missing feature supported by the current DITypeIdentifierMap (which I'm slowly making redudant). The only remaining difference is that the DITypeIdentifierMap has a "the-last-one-wins" rule, whereas DICompositeType::buildODRType has a "the-first-one-wins" rule. For now I'm leaving behind DICompositeType::getODRType since it has obvious, low-level semantics that are convenient for unit testing. llvm-svn: 266786
Diffstat (limited to 'llvm/test/Linker/Inputs')
-rw-r--r--llvm/test/Linker/Inputs/dicompositetype-unique.ll4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/test/Linker/Inputs/dicompositetype-unique.ll b/llvm/test/Linker/Inputs/dicompositetype-unique.ll
index c2389e9a63c..e1537b93dfe 100644
--- a/llvm/test/Linker/Inputs/dicompositetype-unique.ll
+++ b/llvm/test/Linker/Inputs/dicompositetype-unique.ll
@@ -1,4 +1,6 @@
-!named = !{!0, !1}
+!named = !{!0, !1, !2, !3}
!0 = !DIFile(filename: "abc", directory: "/path/to")
!1 = !DICompositeType(tag: DW_TAG_class_type, name: "T2", identifier: "T", file: !0)
+!2 = !DICompositeType(tag: DW_TAG_class_type, name: "FwdTDef", identifier: "FwdT", file: !0)
+!3 = !DICompositeType(tag: DW_TAG_class_type, flags: DIFlagFwdDecl, name: "BothFwdT2", identifier: "BothFwdT", file: !0)
OpenPOWER on IntegriCloud