mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164728 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -285,12 +285,15 @@ public:
|
|||||||
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
||||||
/// specified, it will be added to the instruction.
|
/// specified, it will be added to the instruction.
|
||||||
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
|
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
|
||||||
bool isVolatile = false, MDNode *TBAATag = 0) {
|
bool isVolatile = false, MDNode *TBAATag = 0,
|
||||||
return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag);
|
MDNode *TBAAStructTag = 0) {
|
||||||
|
return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag,
|
||||||
|
TBAAStructTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
||||||
bool isVolatile = false, MDNode *TBAATag = 0);
|
bool isVolatile = false, MDNode *TBAATag = 0,
|
||||||
|
MDNode *TBAAStructTag = 0);
|
||||||
|
|
||||||
/// CreateMemMove - Create and insert a memmove between the specified
|
/// CreateMemMove - Create and insert a memmove between the specified
|
||||||
/// pointers. If the pointers aren't i8*, they will be converted. If a TBAA
|
/// pointers. If the pointers aren't i8*, they will be converted. If a TBAA
|
||||||
|
@ -80,7 +80,7 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
|
|||||||
|
|
||||||
CallInst *IRBuilderBase::
|
CallInst *IRBuilderBase::
|
||||||
CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
||||||
bool isVolatile, MDNode *TBAATag) {
|
bool isVolatile, MDNode *TBAATag, MDNode *TBAAStructTag) {
|
||||||
Dst = getCastedInt8PtrValue(Dst);
|
Dst = getCastedInt8PtrValue(Dst);
|
||||||
Src = getCastedInt8PtrValue(Src);
|
Src = getCastedInt8PtrValue(Src);
|
||||||
|
|
||||||
@ -94,6 +94,10 @@ CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
|||||||
// Set the TBAA info if present.
|
// Set the TBAA info if present.
|
||||||
if (TBAATag)
|
if (TBAATag)
|
||||||
CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);
|
CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);
|
||||||
|
|
||||||
|
// Set the TBAA Struct info if present.
|
||||||
|
if (TBAAStructTag)
|
||||||
|
CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag);
|
||||||
|
|
||||||
return CI;
|
return CI;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user