As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102862 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index f7db0d1..92d15d9 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -870,8 +870,7 @@
                                  ReturnValueSlot ReturnValue,
                                  const CallArgList &CallArgs,
                                  const Decl *TargetDecl,
-                                 unsigned MDKind,
-                                 llvm::MDNode *Metadata) {
+                                 llvm::Instruction **callOrInvoke) {
   // FIXME: We no longer need the types from CallArgs; lift up and simplify.
   llvm::SmallVector<llvm::Value*, 16> Args;
 
@@ -997,8 +996,8 @@
                               Args.data(), Args.data()+Args.size());
     EmitBlock(Cont);
   }
-  if (Metadata) {
-    CS->setMetadata(MDKind, Metadata);
+  if (callOrInvoke) {
+    *callOrInvoke = CS.getInstruction();
   }
 
   CS.setAttributes(Attrs);