mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
[Debug Info] add a template class DITypedArray.
Typedef DIArray to DITypedArray<DIDescriptor>. Also typedef DITypeArray as DITypedArray<DITypeRef>. This is the third of a series of patches to handle type uniqueing of the type array for a subroutine type. This commit should have no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214115 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -956,6 +956,18 @@ DIArray DIBuilder::getOrCreateArray(ArrayRef<Value *> Elements) {
|
||||
return DIArray(MDNode::get(VMContext, Elements));
|
||||
}
|
||||
|
||||
/// getOrCreateTypeArray - Get a DITypeArray, create one if required.
|
||||
DITypeArray DIBuilder::getOrCreateTypeArray(ArrayRef<Value *> Elements) {
|
||||
SmallVector<llvm::Value *, 16> Elts;
|
||||
for (unsigned i = 0, e = Elements.size(); i != e; ++i) {
|
||||
if (Elements[i] && isa<MDNode>(Elements[i]))
|
||||
Elts.push_back(DIType(cast<MDNode>(Elements[i])).getRef());
|
||||
else
|
||||
Elts.push_back(Elements[i]);
|
||||
}
|
||||
return DITypeArray(MDNode::get(VMContext, Elts));
|
||||
}
|
||||
|
||||
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
||||
/// implicitly uniques the values returned.
|
||||
DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) {
|
||||
|
Reference in New Issue
Block a user