-uint64_t DIVariable::getAddrElement(unsigned Idx) const {
- DIDescriptor ComplexExpr = getDescriptorField(8);
- if (Idx < ComplexExpr->getNumOperands())
- if (auto *CI = dyn_cast_or_null<ConstantInt>(ComplexExpr->getOperand(Idx)))
+/// getInlinedAt - If this variable is inlined then return inline location.
+MDNode *DIVariable::getInlinedAt() const { return getNodeField(DbgNode, 7); }
+
+/// Return the size reported by the variable's type.
+unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) {
+ DIType Ty = getType().resolve(Map);
+ // Follow derived types until we reach a type that
+ // reports back a size.
+ while (Ty.isDerivedType() && !Ty.getSizeInBits()) {
+ DIDerivedType DT(&*Ty);
+ Ty = DT.getTypeDerivedFrom().resolve(Map);
+ }
+ assert(Ty.getSizeInBits() && "type with size 0");
+ return Ty.getSizeInBits();
+}
+
+uint64_t DIExpression::getElement(unsigned Idx) const {
+ unsigned I = Idx + 1;
+ if (I < DbgNode->getNumOperands())
+ if (auto *CI = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(I)))