summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2012-09-28 21:58:29 +0000
committerDan Gohman <gohman@apple.com>2012-09-28 21:58:29 +0000
commit22695fcec3b206eec0e04c52a089c8b4c520d24b (patch)
tree07972f1110fb073ede511d9e524d54e5663777e7 /clang/lib/CodeGen/CGExprAgg.cpp
parent3852b3e1891939f4cc008025494b07894a408707 (diff)
downloadbcm5719-llvm-22695fcec3b206eec0e04c52a089c8b4c520d24b.tar.gz
bcm5719-llvm-22695fcec3b206eec0e04c52a089c8b4c520d24b.zip
Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls for
struct assignment. llvm-svn: 164853
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 48b21d2f851..c9ffc19a8b6 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -1362,11 +1362,17 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
}
}
}
+
+ // Determine the metadata to describe the position of any padding in this
+ // memcpy, as well as the TBAA tags for the members of the struct, in case
+ // the optimizer wishes to expand it in to scalar memory operations.
+ llvm::MDNode *TBAAStructTag = CGM.getTBAAStructInfo(Ty);
Builder.CreateMemCpy(DestPtr, SrcPtr,
llvm::ConstantInt::get(IntPtrTy,
TypeInfo.first.getQuantity()),
- alignment.getQuantity(), isVolatile);
+ alignment.getQuantity(), isVolatile,
+ /*TBAATag=*/0, TBAAStructTag);
}
void CodeGenFunction::MaybeEmitStdInitializerListCleanup(llvm::Value *loc,
OpenPOWER on IntegriCloud