Only one custom meadata of each kind can be attached with an instruction.
[oota-llvm.git] / include / llvm / Support / IRBuilder.h
index b5e17871ea0fb7bc31cf92ba6aaf1efea9c0b4f6..1f659787eb795cecd64b9fc3126918a00ef9877d 100644 (file)
@@ -148,7 +148,7 @@ public:
   /// SetDebugLocation -  Set location information for the given instruction.
   void SetDebugLocation(Instruction *I) {
     if (CurDbgLocation)
-      Context.getMetadata().setMD(MDKind, CurDbgLocation, I);
+      Context.getMetadata().addMD(MDKind, CurDbgLocation, I);
   }
 
   /// Insert - Insert and return the specified instruction.
@@ -156,7 +156,7 @@ public:
   InstTy *Insert(InstTy *I, const Twine &Name = "") const {
     this->InsertHelper(I, Name, BB, InsertPt);
     if (CurDbgLocation)
-      Context.getMetadata().setMD(MDKind, CurDbgLocation, I);
+      Context.getMetadata().addMD(MDKind, CurDbgLocation, I);
     return I;
   }