projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
957b9cd
)
[SimplifyLibCalls] Fix -Wunused-result after D53342/r372091
author
Fangrui Song
<maskray@google.com>
Tue, 17 Sep 2019 09:56:55 +0000
(09:56 +0000)
committer
Fangrui Song
<maskray@google.com>
Tue, 17 Sep 2019 09:56:55 +0000
(09:56 +0000)
llvm-svn: 372096
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index
9dfb016
..
526988d
100644
(file)
--- a/
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@
-612,7
+612,8
@@
Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
// strncpy(x, "", y) -> memset(align 1 x, '\0', y)
CallInst *NewCI = B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
- NewCI->getAttributes().addParamAttributes(CI->getContext(), 0, ArgAttrs);
+ NewCI->setAttributes(NewCI->getAttributes().addParamAttributes(
+ CI->getContext(), 0, ArgAttrs));
return Dst;
}