aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/DIBuilder.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-04 06:20:49 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-04 06:20:49 +0000
commita7645a3c66668da5e2bc772a8e5ab03dc301610c (patch)
tree30ef30b7396a9bd8adfcc9c0461959aac9a94302 /lib/VMCore/DIBuilder.cpp
parent319d594e22c3db55114f233ca398f9760e3f6ed9 (diff)
Add a 'count' field to the DWARF subrange.
The count field is necessary because there isn't a difference between the 'lo' and 'hi' attributes for a one-element array and a zero-element array. When the count is '0', we know that this is a zero-element array. When it's >=1, then it's a normal constant sized array. When it's -1, then the array is unbounded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/DIBuilder.cpp')
-rw-r--r--lib/VMCore/DIBuilder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VMCore/DIBuilder.cpp b/lib/VMCore/DIBuilder.cpp
index 74b69e4617..2b77edc7f9 100644
--- a/lib/VMCore/DIBuilder.cpp
+++ b/lib/VMCore/DIBuilder.cpp
@@ -741,11 +741,13 @@ DIArray DIBuilder::getOrCreateArray(ArrayRef<Value *> Elements) {
/// getOrCreateSubrange - Create a descriptor for a value range. This
/// implicitly uniques the values returned.
-DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Hi) {
+DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Hi,
+ int64_t Count) {
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subrange_type),
ConstantInt::get(Type::getInt64Ty(VMContext), Lo),
- ConstantInt::get(Type::getInt64Ty(VMContext), Hi)
+ ConstantInt::get(Type::getInt64Ty(VMContext), Hi),
+ ConstantInt::get(Type::getInt64Ty(VMContext), Count)
};
return DISubrange(MDNode::get(VMContext, Elts));