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:
4828811
)
[yaml2obj] - Replace a loop with write_zeros(). NFCI.
author
George Rimar
<grimar@accesssoftek.com>
Mon, 29 Apr 2019 12:05:53 +0000
(12:05 +0000)
committer
George Rimar
<grimar@accesssoftek.com>
Mon, 29 Apr 2019 12:05:53 +0000
(12:05 +0000)
This looks better.
llvm-svn: 359444
llvm/tools/yaml2obj/yaml2elf.cpp
patch
|
blob
|
history
diff --git
a/llvm/tools/yaml2obj/yaml2elf.cpp
b/llvm/tools/yaml2obj/yaml2elf.cpp
index
e3246bc
..
ba07c9c
100644
(file)
--- a/
llvm/tools/yaml2obj/yaml2elf.cpp
+++ b/
llvm/tools/yaml2obj/yaml2elf.cpp
@@
-40,8
+40,7
@@
class ContiguousBlobAccumulator {
Align = 1;
uint64_t CurrentOffset = InitialOffset + OS.tell();
uint64_t AlignedOffset = alignTo(CurrentOffset, Align);
- for (; CurrentOffset != AlignedOffset; ++CurrentOffset)
- OS.write('\0');
+ OS.write_zeros(AlignedOffset - CurrentOffset);
return AlignedOffset; // == CurrentOffset;
}