diff options
| author | Rui Ueyama <ruiu@google.com> | 2018-02-28 00:01:31 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2018-02-28 00:01:31 +0000 |
| commit | 37254065ddd3d4a85450b04a2e7ba2b8ae4439fe (patch) | |
| tree | 1d35470fb4924f0eddc73b210f595ba576b86c44 /lld/wasm/Writer.cpp | |
| parent | 99eb42c0c5ebe7ffe65c1bd7efeeaf9f3edf8340 (diff) | |
| download | bcm5719-llvm-37254065ddd3d4a85450b04a2e7ba2b8ae4439fe.tar.gz bcm5719-llvm-37254065ddd3d4a85450b04a2e7ba2b8ae4439fe.zip | |
[WebAssembly] Use StringRef instead of `const char *`.
Differential Revision: https://reviews.llvm.org/D43721
llvm-svn: 326269
Diffstat (limited to 'lld/wasm/Writer.cpp')
| -rw-r--r-- | lld/wasm/Writer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 90252b71fe0..2f3c455851f 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -357,24 +357,24 @@ void Writer::createRelocSections() { // Don't use iterator here since we are adding to OutputSection size_t OrigSize = OutputSections.size(); for (size_t i = 0; i < OrigSize; i++) { - OutputSection *S = OutputSections[i]; - const char *name; - uint32_t Count = S->numRelocations(); + OutputSection *OSec = OutputSections[i]; + uint32_t Count = OSec->numRelocations(); if (!Count) continue; - if (S->Type == WASM_SEC_DATA) - name = "reloc.DATA"; - else if (S->Type == WASM_SEC_CODE) - name = "reloc.CODE"; + StringRef Name; + if (OSec->Type == WASM_SEC_DATA) + Name = "reloc.DATA"; + else if (OSec->Type == WASM_SEC_CODE) + Name = "reloc.CODE"; else llvm_unreachable("relocations only supported for code and data"); - SyntheticSection *Section = createSyntheticSection(WASM_SEC_CUSTOM, name); + SyntheticSection *Section = createSyntheticSection(WASM_SEC_CUSTOM, Name); raw_ostream &OS = Section->getStream(); - writeUleb128(OS, S->Type, "reloc section"); + writeUleb128(OS, OSec->Type, "reloc section"); writeUleb128(OS, Count, "reloc count"); - S->writeRelocations(OS); + OSec->writeRelocations(OS); } } |

