~ubuntu-branches/ubuntu/precise/llvm-2.8/precise

« back to all changes in this revision

Viewing changes to lib/VMCore/Metadata.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-09-21 14:03:34 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100921140334-i4xxl0a768fcqffl
Tags: 2.8~20100921-0ubuntu1
New upstream snapshot, taken from the 2.8 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
354
354
 
355
355
  // InsertPoint will have been set by the FindNodeOrInsertPos call.
356
356
  pImpl->MDNodeSet.InsertNode(this, InsertPoint);
 
357
 
 
358
  // If this MDValue was previously function-local but no longer is, clear
 
359
  // its function-local flag.
 
360
  if (isFunctionLocal() && !isFunctionLocalValue(To)) {
 
361
    bool isStillFunctionLocal = false;
 
362
    for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
 
363
      Value *V = getOperand(i);
 
364
      if (!V) continue;
 
365
      if (isFunctionLocalValue(V)) {
 
366
        isStillFunctionLocal = true;
 
367
        break;
 
368
      }
 
369
    }
 
370
    if (!isStillFunctionLocal)
 
371
      setValueSubclassData(getSubclassDataFromValue() & ~FunctionLocalBit);
 
372
  }
357
373
}
358
374
 
359
375
//===----------------------------------------------------------------------===//
387
403
 
388
404
/// addOperand - Add metadata Operand.
389
405
void NamedMDNode::addOperand(MDNode *M) {
 
406
  assert(!M->isFunctionLocal() &&
 
407
         "NamedMDNode operands must not be function-local!");
390
408
  getNMDOps(Operands).push_back(TrackingVH<MDNode>(M));
391
409
}
392
410