aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
diff options
context:
space:
mode:
authorgbtozers <stephen.tozer@sony.com>2020-09-30 16:29:53 +0100
committerStephen Tozer <Stephen.Tozer@Sony.com>2021-03-05 17:02:24 +0000
commit65600cb2a7e940babf6c493503b9d3fd19f8cb06 (patch)
treefa869889dc445a93229a2a421a398b5905187cc9 /llvm/lib/Bitcode/Reader/MetadataLoader.cpp
parentadc35b689f3a31c57fe56a8850c9c17fffea7199 (diff)
downloadllvm-65600cb2a7e940babf6c493503b9d3fd19f8cb06.zip
llvm-65600cb2a7e940babf6c493503b9d3fd19f8cb06.tar.gz
llvm-65600cb2a7e940babf6c493503b9d3fd19f8cb06.tar.bz2
[DebugInfo] Add DIArgList MD to store multple values in DbgVariableIntrinsics
This patch adds a new metadata node, DIArgList, which contains a list of SSA values. This node is in many ways similar in function to the existing ValueAsMetadata node, with the difference being that it tracks a list instead of a single value. Internally, it uses ValueAsMetadata to track the individual values, but there is also a reasonable amount of DIArgList-specific value-tracking logic on top of that. Similar to ValueAsMetadata, it is a special case in parsing and printing due to the fact that it requires a function state (as it may reference function-local values). This patch should not result in any immediate functional change; it allows for DIArgLists to be parsed and printed, but debug variable intrinsics do not yet recognize them as a valid argument (outside of parsing). Differential Revision: https://reviews.llvm.org/D88175
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 8cdda62..0567f96 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -2076,6 +2076,16 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
return Err;
break;
}
+ case bitc::METADATA_ARG_LIST: {
+ SmallVector<ValueAsMetadata *, 4> Elts;
+ Elts.reserve(Record.size());
+ for (uint64_t Elt : Record)
+ Elts.push_back(dyn_cast_or_null<ValueAsMetadata>(getMDOrNull(Elt)));
+
+ MetadataList.assignValue(DIArgList::get(Context, Elts), NextMetadataNo);
+ NextMetadataNo++;
+ break;
+ }
}
return Error::success();
#undef GET_OR_DISTINCT