summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
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/Bitcode/Reader/MetadataLoader.cpp
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/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 4781cfe3dea..e77965be216 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1562,21 +1562,35 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
break;
}
case bitc::METADATA_GLOBAL_VAR: {
- if (Record.size() < 11 || Record.size() > 12)
+ if (Record.size() < 11 || Record.size() > 13)
return error("Invalid record");
IsDistinct = Record[0] & 1;
unsigned Version = Record[0] >> 1;
- if (Version == 1) {
+ if (Version == 2) {
+ MetadataList.assignValue(
+ GET_OR_DISTINCT(
+ DIGlobalVariable,
+ (Context, getMDOrNull(Record[1]), getMDString(Record[2]),
+ getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
+ getDITypeRefOrNull(Record[6]), Record[7], Record[8],
+ getMDOrNull(Record[9]), getMDOrNull(Record[10]), Record[11])),
+ NextMetadataNo);
+
+ NextMetadataNo++;
+ } else if (Version == 1) {
+ // No upgrade necessary. A null field will be introduced to indicate
+ // that no parameter information is available.
MetadataList.assignValue(
GET_OR_DISTINCT(DIGlobalVariable,
(Context, getMDOrNull(Record[1]),
getMDString(Record[2]), getMDString(Record[3]),
getMDOrNull(Record[4]), Record[5],
getDITypeRefOrNull(Record[6]), Record[7], Record[8],
- getMDOrNull(Record[10]), Record[11])),
+ getMDOrNull(Record[10]), nullptr, Record[11])),
NextMetadataNo);
+
NextMetadataNo++;
} else if (Version == 0) {
// Upgrade old metadata, which stored a global variable reference or a
@@ -1607,7 +1621,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
(Context, getMDOrNull(Record[1]), getMDString(Record[2]),
getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
getDITypeRefOrNull(Record[6]), Record[7], Record[8],
- getMDOrNull(Record[10]), AlignInBits));
+ getMDOrNull(Record[10]), nullptr, AlignInBits));
DIGlobalVariableExpression *DGVE = nullptr;
if (Attach || Expr)
OpenPOWER on IntegriCloud