summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorMatthew Voss <matthew.voss@sony.com>2018-10-03 18:44:53 +0000
committerMatthew Voss <matthew.voss@sony.com>2018-10-03 18:44:53 +0000
commitf8ab35a4f464753751c1df2b56b6c2f9c75d56a7 (patch)
treecd817f07400276d4cf0efea2832f29c75c4d7963 /llvm/lib/CodeGen/AsmPrinter
parentb80d27a916988f45fa851f23dbb0cdb5649916f7 (diff)
downloadbcm5719-llvm-f8ab35a4f464753751c1df2b56b6c2f9c75d56a7.tar.gz
bcm5719-llvm-f8ab35a4f464753751c1df2b56b6c2f9c75d56a7.zip
Emit template type and value parameter DIEs for template variables.
Summary: Ensure the TemplateParam attribute of the DIGlobalVariable node is translated into the proper DIEs. Resolves https://bugs.llvm.org/show_bug.cgi?id=22119 Reviewers: dblaikie, probinson, aprantl, JDevlieghere, clayborg, whitequark, deadalnix Reviewed By: dblaikie Subscribers: llvm-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D52057 llvm-svn: 343706
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 496c80a08e3..d8d6f76d71e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -160,6 +160,9 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(
addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata,
AlignInBytes);
+ if (MDTuple *TP = GV->getTemplateParams())
+ addTemplateParams(*VariableDIE, DINodeArray(TP));
+
// Add location.
bool addToAccelTable = false;
DIELoc *Loc = nullptr;
OpenPOWER on IntegriCloud