Copy metadata associated with CI

llvm-svn: 84114
This commit is contained in:
Devang Patel
2009-10-14 17:03:29 +00:00
parent ebaa76ed0d
commit f33cfaf760

View File

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