X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FDIBuilder.cpp;h=a621f71a7f56b77c893f9fc6a921eebf6471c9a3;hb=be63d589633bbfa068b923c60eaaeee1b27647c5;hp=16ff8a075703e828d31bfe690713f914daec6a70;hpb=807538b567af91393264a425ed985b57bd908e71;p=oota-llvm.git diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 16ff8a07570..a621f71a7f5 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -875,11 +875,8 @@ void DIBuilder::retainType(DIType T) { /// createUnspecifiedParameter - Create unspeicified type descriptor /// for the subroutine type. -DITrivialType DIBuilder::createUnspecifiedParameter() { - Value *Elts[] = { - GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_parameters) - }; - return DITrivialType(MDNode::get(VMContext, Elts)); +DIBasicType DIBuilder::createUnspecifiedParameter() { + return DIBasicType(); } /// createForwardDecl - Create a temporary forward-declared type that @@ -1103,6 +1100,28 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope, 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 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.