diff options
author | Reid Kleckner <rnk@google.com> | 2017-06-22 01:07:05 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-06-22 01:07:05 +0000 |
commit | ef5817579ba51ee2f4c701d1d7bd6199fbb254d7 (patch) | |
tree | 5b947fac1c769a234dd9486943b6e6d06f0f610c /llvm/lib | |
parent | f74609b15f941cf5af298d5e983de2274118f988 (diff) | |
download | bcm5719-llvm-ef5817579ba51ee2f4c701d1d7bd6199fbb254d7.tar.gz bcm5719-llvm-ef5817579ba51ee2f4c701d1d7bd6199fbb254d7.zip |
[wasm] Fix WebAssembly asm backend after r305968
llvm-svn: 305978
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp index 4f20096c158..2e43c6a6625 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp @@ -37,7 +37,7 @@ public: : MCAsmBackend(), Is64Bit(Is64Bit) {} ~WebAssemblyAsmBackendELF() override {} - void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, + void applyFixup(const MCFixup &Fixup, MutableArrayRef<char> Data, uint64_t Value, bool IsPCRel, MCContext &Ctx) const override; MCObjectWriter *createObjectWriter(raw_pwrite_stream &OS) const override; @@ -77,7 +77,7 @@ public: const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override; - void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, + void applyFixup(const MCFixup &Fixup, MutableArrayRef<char> Data, uint64_t Value, bool IsPCRel, MCContext &Ctx) const override; MCObjectWriter *createObjectWriter(raw_pwrite_stream &OS) const override; @@ -105,9 +105,10 @@ bool WebAssemblyAsmBackendELF::writeNopData(uint64_t Count, return true; } -void WebAssemblyAsmBackendELF::applyFixup(const MCFixup &Fixup, char *Data, - unsigned DataSize, uint64_t Value, - bool IsPCRel, MCContext &Ctx) const { +void WebAssemblyAsmBackendELF::applyFixup(const MCFixup &Fixup, + MutableArrayRef<char> Data, + uint64_t Value, bool IsPCRel, + MCContext &Ctx) const { const MCFixupKindInfo &Info = getFixupKindInfo(Fixup.getKind()); assert(Info.Flags == 0 && "WebAssembly does not use MCFixupKindInfo flags"); @@ -119,7 +120,7 @@ void WebAssemblyAsmBackendELF::applyFixup(const MCFixup &Fixup, char *Data, Value <<= Info.TargetOffset; unsigned Offset = Fixup.getOffset(); - assert(Offset + NumBytes <= DataSize && "Invalid fixup offset!"); + assert(Offset + NumBytes <= Data.size() && "Invalid fixup offset!"); // For each byte of the fragment that the fixup touches, mask in the // bits from the fixup value. @@ -163,9 +164,10 @@ bool WebAssemblyAsmBackend::writeNopData(uint64_t Count, return true; } -void WebAssemblyAsmBackend::applyFixup(const MCFixup &Fixup, char *Data, - unsigned DataSize, uint64_t Value, - bool IsPCRel, MCContext &Ctx) const { +void WebAssemblyAsmBackend::applyFixup(const MCFixup &Fixup, + MutableArrayRef<char> Data, + uint64_t Value, bool IsPCRel, + MCContext &Ctx) const { const MCFixupKindInfo &Info = getFixupKindInfo(Fixup.getKind()); assert(Info.Flags == 0 && "WebAssembly does not use MCFixupKindInfo flags"); @@ -177,7 +179,7 @@ void WebAssemblyAsmBackend::applyFixup(const MCFixup &Fixup, char *Data, Value <<= Info.TargetOffset; unsigned Offset = Fixup.getOffset(); - assert(Offset + NumBytes <= DataSize && "Invalid fixup offset!"); + assert(Offset + NumBytes <= Data.size() && "Invalid fixup offset!"); // For each byte of the fragment that the fixup touches, mask in the // bits from the fixup value. |