summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a7658e5e14f..36ad7f514ec 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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();
}
}
OpenPOWER on IntegriCloud