mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Add support for DISubrange
This commit is contained in:
@@ -205,6 +205,7 @@ struct DIBase
|
||||
LocalVariable,
|
||||
Expression,
|
||||
LexicalBlock,
|
||||
Subrange,
|
||||
} type;
|
||||
|
||||
DIBase(Type t) : type(t) {}
|
||||
|
||||
@@ -234,6 +234,12 @@ bool Program::ParseDebugMetaRecord(const LLVMBC::BlockOrRecord &metaRecord, Meta
|
||||
|
||||
meta.children = {getMeta(metaRecord.ops[1]), getMeta(metaRecord.ops[2])};
|
||||
}
|
||||
else if(id == MetaDataRecord::SUBRANGE)
|
||||
{
|
||||
meta.distinct = (metaRecord.ops[0] & 0x1);
|
||||
|
||||
meta.dwarf = new DISubrange(metaRecord.ops[1], LLVMBC::BitReader::svbr(metaRecord.ops[2]));
|
||||
}
|
||||
else if(id == MetaDataRecord::EXPRESSION)
|
||||
{
|
||||
DIExpression *expr = new DIExpression;
|
||||
@@ -544,6 +550,16 @@ rdcstr DILexicalBlock::toString() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
rdcstr DISubrange::toString() const
|
||||
{
|
||||
rdcstr ret = "!DISubrange(";
|
||||
ret += StringFormat::Fmt("count: %llu", count);
|
||||
if(lowerBound)
|
||||
ret += StringFormat::Fmt(", lowerBound: %lld", lowerBound);
|
||||
ret += ")";
|
||||
return ret;
|
||||
}
|
||||
|
||||
}; // namespace DXIL
|
||||
|
||||
template <>
|
||||
|
||||
@@ -695,6 +695,20 @@ struct DILexicalBlock : public DIBase
|
||||
virtual rdcstr toString() const;
|
||||
};
|
||||
|
||||
struct DISubrange : public DIBase
|
||||
{
|
||||
static const DIBase::Type DIType = DIBase::Subrange;
|
||||
DISubrange(uint64_t count, int64_t lowerBound)
|
||||
: DIBase(DIType), count(count), lowerBound(lowerBound)
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t count;
|
||||
int64_t lowerBound;
|
||||
|
||||
virtual rdcstr toString() const;
|
||||
};
|
||||
|
||||
}; // namespace DXIL
|
||||
|
||||
DECLARE_REFLECTION_ENUM(DXIL::DW_LANG);
|
||||
|
||||
Reference in New Issue
Block a user