Now that hopefully all direct accesses to InvokeInst operands are fixed
[oota-llvm.git] / include / llvm / Metadata.h
index 4e459bf7bf5c113d04ab2de4c8f165f8c9ea2f9e..ff3e03e96fd86bdb9946ae509eefe09b9cc1558b 100644 (file)
@@ -43,8 +43,10 @@ protected:
 
 public:
   static MDString *get(LLVMContext &Context, StringRef Str);
-  static MDString *get(LLVMContext &Context, const char *Str);
-  
+  static MDString *get(LLVMContext &Context, const char *Str) {
+    return get(Context, Str ? StringRef(Str) : StringRef());
+  }
+
   StringRef getString() const { return Str; }
 
   unsigned getLength() const { return (unsigned)Str.size(); }
@@ -75,6 +77,7 @@ class MDNode : public Value, public FoldingSetNode {
   MDNode(const MDNode &);                // DO NOT IMPLEMENT
   void operator=(const MDNode &);        // DO NOT IMPLEMENT
   friend class MDNodeOperand;
+  friend class LLVMContextImpl;
 
   /// NumOperands - This many 'MDNodeOperand' items are co-allocated onto the
   /// end of this MDNode.
@@ -103,7 +106,8 @@ class MDNode : public Value, public FoldingSetNode {
     FL_Yes = 1
   };
   
-  // Replace each instance of F from the operand list of this node with T.
+  /// replaceOperand - Replace each instance of F from the operand list of this 
+  /// node with T.
   void replaceOperand(MDNodeOperand *Op, Value *NewVal);
   ~MDNode();
 
@@ -161,9 +165,7 @@ private:
   bool isNotUniqued() const { 
     return (getSubclassDataFromValue() & NotUniquedBit) != 0;
   }
-  void setIsNotUniqued() {
-    setValueSubclassData(getSubclassDataFromValue() | NotUniquedBit);
-  }
+  void setIsNotUniqued();
   
   // Shadow Value::setValueSubclassData with a private forwarding method so that
   // any future subclasses cannot accidentally use it.