/// createUnspecifiedParameter - Create unspeicified type descriptor
/// for the subroutine type.
DIBasicType DIBuilder::createUnspecifiedParameter() {
- return DIBasicType(nullptr);
+ return DIBasicType();
}
/// createForwardDecl - Create a temporary forward-declared type that
return DIVariable(MDNode::get(VMContext, Elts));
}
+/// createVariablePiece - Create a descriptor to describe one part
+/// of aggregate variable that is fragmented across multiple Values.
+DIVariable DIBuilder::createVariablePiece(DIVariable Variable,
+ unsigned OffsetInBytes,
+ unsigned SizeInBytes) {
+ assert(SizeInBytes > 0 && "zero-size piece");
+ Value *Addr[] = {
+ ConstantInt::get(Type::getInt32Ty(VMContext), OpPiece),
+ ConstantInt::get(Type::getInt32Ty(VMContext), OffsetInBytes),
+ ConstantInt::get(Type::getInt32Ty(VMContext), SizeInBytes)
+ };
+
+ assert((Variable->getNumOperands() == 8 || Variable.isVariablePiece()) &&
+ "variable already has a complex address");
+ SmallVector<Value *, 9> Elts;
+ for (unsigned i = 0; i < 8; ++i)
+ Elts.push_back(Variable->getOperand(i));
+
+ Elts.push_back(MDNode::get(VMContext, Addr));
+ return DIVariable(MDNode::get(VMContext, Elts));
+}
+
/// createFunction - Create a new descriptor for the specified function.
/// FIXME: this is added for dragonegg. Once we update dragonegg
/// to call resolve function, this will be removed.
/// createLexicalBlockFile - This creates a new MDNode that encapsulates
/// an existing scope with a new filename.
DILexicalBlockFile DIBuilder::createLexicalBlockFile(DIDescriptor Scope,
- DIFile File) {
+ DIFile File,
+ unsigned Discriminator) {
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
File.getFileNode(),
- Scope
+ Scope,
+ ConstantInt::get(Type::getInt32Ty(VMContext), Discriminator),
};
DILexicalBlockFile R(MDNode::get(VMContext, Elts));
assert(
}
DILexicalBlock DIBuilder::createLexicalBlock(DIDescriptor Scope, DIFile File,
- unsigned Line, unsigned Col,
- unsigned Discriminator) {
+ unsigned Line, unsigned Col) {
// FIXME: This isn't thread safe nor the right way to defeat MDNode uniquing.
// I believe the right way is to have a self-referential element in the node.
// Also: why do we bother with line/column - they're not used and the
getNonCompileUnitScope(Scope),
ConstantInt::get(Type::getInt32Ty(VMContext), Line),
ConstantInt::get(Type::getInt32Ty(VMContext), Col),
- ConstantInt::get(Type::getInt32Ty(VMContext), Discriminator),
ConstantInt::get(Type::getInt32Ty(VMContext), unique_id++)
};
DILexicalBlock R(MDNode::get(VMContext, Elts));