summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/Analysis.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2016-10-27 14:48:09 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2016-10-27 14:48:09 +0000
commit807f732ce84dd2f4f253ae4bda4b8a49ef79906a (patch)
tree5a7e845cf040511bd16c00ae083dacbd7f702915 /llvm/lib/CodeGen/Analysis.cpp
parent046da74699f53fc0c81e5c02c38038adb3a86c56 (diff)
downloadbcm5719-llvm-807f732ce84dd2f4f253ae4bda4b8a49ef79906a.tar.gz
bcm5719-llvm-807f732ce84dd2f4f253ae4bda4b8a49ef79906a.zip
Fix memory issue in AttrBuilder::removeAttribute uses.
Summary: Found when running Valgrind. This removes two unnecessary assignments when using AttrBuilder::removeAttribute. AttrBuilder::removeAttribute returns a reference to the object. As the LHSes were the same as the callees, the assignments resulted in memcpy calls where dst = src. Commited on behalf-of: dstenb (David Stenberg) Reviewers: mkuper, rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25460 llvm-svn: 285298
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r--llvm/lib/CodeGen/Analysis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp
index 6582d24da82..51136030379 100644
--- a/llvm/lib/CodeGen/Analysis.cpp
+++ b/llvm/lib/CodeGen/Analysis.cpp
@@ -541,8 +541,8 @@ bool llvm::attributesPermitTailCall(const Function *F, const Instruction *I,
// Noalias is completely benign as far as calling convention goes, it
// shouldn't affect whether the call is a tail call.
- CallerAttrs = CallerAttrs.removeAttribute(Attribute::NoAlias);
- CalleeAttrs = CalleeAttrs.removeAttribute(Attribute::NoAlias);
+ CallerAttrs.removeAttribute(Attribute::NoAlias);
+ CalleeAttrs.removeAttribute(Attribute::NoAlias);
if (CallerAttrs.contains(Attribute::ZExt)) {
if (!CalleeAttrs.contains(Attribute::ZExt))
OpenPOWER on IntegriCloud