]> granicus.if.org Git - clang/commitdiff
Copy metadata associated with CI
authorDevang Patel <dpatel@apple.com>
Wed, 14 Oct 2009 17:03:29 +0000 (17:03 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 14 Oct 2009 17:03:29 +0000 (17:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84114 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index a7658e5e14fa9d1cfc528d166691544b45cc91a9..36ad7f514ec811e0bd9ac9c7c66ca891f0660e75 100644 (file)
@@ -1113,6 +1113,10 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
     if (!CI->use_empty())
       CI->replaceAllUsesWith(NewCall);
 
+    // Copy any custom metadata attached with CI.
+    llvm::MetadataContext &TheMetadata = CI->getContext().getMetadata();
+    TheMetadata.copyMD(CI, NewCall);
+
     CI->eraseFromParent();
   }
 }