Home | History | Annotate | Download | only in VMCore

Lines Matching defs:MDNode

48 // Use CallbackVH to hold MDNode operands.
51 MDNode *Parent;
53 MDNodeOperand(Value *V, MDNode *P) : CallbackVH(V), Parent(P) {}
77 // MDNode implementation.
81 /// the end of the MDNode.
82 static MDNodeOperand *getOperandPtr(MDNode *N, unsigned Op) {
88 MDNode::MDNode(LLVMContext &C, ArrayRef<Value*> Vals, bool isFunctionLocal)
103 /// ~MDNode - Destroy MDNode.
104 MDNode::~MDNode() {
130 if (MDNode *MD = dyn_cast<MDNode>(V))
136 static const Function *assertLocalFunction(const MDNode *N) {
143 if (MDNode *MD = dyn_cast<MDNode>(V))
160 // critical code because it recursively visits all the MDNode's operands.
161 const Function *MDNode::getFunction() const {
173 void MDNode::destroy() {
176 this->~MDNode();
181 /// function-local MDNode.
184 (isa<MDNode>(V) && cast<MDNode>(V)->isFunctionLocal());
187 MDNode *MDNode::getMDNode(LLVMContext &Context, ArrayRef<Value*> Vals,
200 MDNode *N = NULL;
226 void *Ptr = malloc(sizeof(MDNode)+Vals.size()*sizeof(MDNodeOperand));
227 N = new (Ptr) MDNode(Context, Vals, isFunctionLocal);
235 MDNode *MDNode::get(LLVMContext &Context, ArrayRef<Value*> Vals) {
239 MDNode *MDNode::getWhenValsUnresolved(LLVMContext &Context,
245 MDNode *MDNode::getIfExists(LLVMContext &Context, ArrayRef<Value*> Vals) {
249 MDNode *MDNode::getTemporary(LLVMContext &Context, ArrayRef<Value*> Vals) {
250 MDNode *N =
251 (MDNode *)malloc(sizeof(MDNode)+Vals.size()*sizeof(MDNodeOperand));
252 N = new (N) MDNode(Context, Vals, FL_No);
259 void MDNode::deleteTemporary(MDNode *N) {
260 assert(N->use_empty() && "Temporary MDNode has uses!");
266 "Temporary MDNode does not have NotUniquedBit set!");
268 "Temporary MDNode has DestroyFlag set!");
274 Value *MDNode::getOperand(unsigned i) const {
275 return *getOperandPtr(const_cast<MDNode*>(this), i);
278 void MDNode::Profile(FoldingSetNodeID &ID) const {
287 void MDNode::setIsNotUniqued() {
294 void MDNode::replaceOperand(MDNodeOperand *Op, Value *To) {
299 // non-function-local MDNode, it can't point to a function-local object.
300 // Handle this case by implicitly dropping the MDNode reference to null.
301 // Likewise if the MDNode is function-local but for a different function.
331 // If we are dropping an argument to null, we choose to not unique the MDNode
346 if (MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint)) {
376 static SmallVector<TrackingVH<MDNode>, 4> &getNMDOps(void *Operands) {
377 return *(SmallVector<TrackingVH<MDNode>, 4>*)Operands;
382 Operands(new SmallVector<TrackingVH<MDNode>, 4>()) {
396 MDNode *NamedMDNode::getOperand(unsigned i) const {
398 return dyn_cast<MDNode>(&*getNMDOps(Operands)[i]);
402 void NamedMDNode::addOperand(MDNode *M) {
405 getNMDOps(Operands).push_back(TrackingVH<MDNode>(M));
428 void Instruction::setMetadata(const char *Kind, MDNode *Node) {
433 MDNode *Instruction::getMetadataImpl(const char *Kind) const {
440 void Instruction::setMetadata(unsigned KindID, MDNode *Node) {
494 MDNode *Instruction::getMetadataImpl(unsigned KindID) const {
512 MDNode*> > &Result) const {
538 MDNode*> > &Result) const {