Adjust CreateDerivedArrayType to also take the lower bound.

Since valid array bounds vary by language, this needs to be passed
in by the source language creating the derived type. Adjust callers
accordingly.
This commit is contained in:
Rene Gollent
2013-04-14 18:44:51 -04:00
parent 88e9c0961a
commit d12519423f
5 changed files with 11 additions and 9 deletions
+4 -4
View File
@@ -253,8 +253,8 @@ DwarfType::CreateDerivedAddressType(address_type_kind addressType,
status_t
DwarfType::CreateDerivedArrayType(uint64 elementCount, bool extendExisting,
ArrayType*& _resultType)
DwarfType::CreateDerivedArrayType(int64 lowerBound, int64 elementCount,
bool extendExisting, ArrayType*& _resultType)
{
DwarfArrayType* resultType = NULL;
BReference<DwarfType> baseTypeReference;
@@ -271,8 +271,8 @@ DwarfType::CreateDerivedArrayType(uint64 elementCount, bool extendExisting,
return B_NO_MEMORY;
DwarfSubrangeType* subrangeType = new(std::nothrow) DwarfSubrangeType(
fTypeContext, fName, NULL, resultType, BVariant((uint64)0),
BVariant(elementCount - 1));
fTypeContext, fName, NULL, resultType, BVariant(lowerBound),
BVariant(lowerBound + elementCount - 1));
if (subrangeType == NULL)
return B_NO_MEMORY;
+2 -1
View File
@@ -115,7 +115,8 @@ public:
AddressType*& _resultType);
virtual status_t CreateDerivedArrayType(
uint64 elementCount,
int64 lowerBound,
int64 elementCount,
bool extendExisting,
ArrayType*& _resultType);
+1 -1
View File
@@ -105,7 +105,7 @@ Type::CreateDerivedAddressType(address_type_kind kind,
status_t
Type::CreateDerivedArrayType(uint64 elementCount,
Type::CreateDerivedArrayType(int64 lowerBound, int64 elementCount,
bool extendExisting, ArrayType*& _resultType)
{
_resultType = NULL;
+2 -1
View File
@@ -141,7 +141,8 @@ public:
AddressType*& _resultType);
virtual status_t CreateDerivedArrayType(
uint64 elementCount,
int64 lowerBound,
int64 elementCount,
bool extendExisting,
// if the current object is already
// an array type, attach an extra
@@ -123,10 +123,10 @@ CppLanguage::ParseTypeExpression(const BString &expression,
return B_ERROR;
if (arrayType == NULL) {
result = _resultType->CreateDerivedArrayType(size, true,
result = _resultType->CreateDerivedArrayType(0, size, true,
arrayType);
} else {
result = arrayType->CreateDerivedArrayType(size, true,
result = arrayType->CreateDerivedArrayType(0, size, true,
arrayType);
}