summaryrefslogtreecommitdiffstats
path: root/lld/wasm/Writer.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-13 00:22:00 +0000
committerSam Clegg <sbc@chromium.org>2018-01-13 00:22:00 +0000
commit4a379c3dd8caeb265d0cb7dae347a0456ce85d84 (patch)
treed43aedc11258db5873a473e91ed17362a111fcf3 /lld/wasm/Writer.cpp
parent4463ae4f6dcb2a59e01e816e2ea0eb9ed8321c9a (diff)
downloadbcm5719-llvm-4a379c3dd8caeb265d0cb7dae347a0456ce85d84.tar.gz
bcm5719-llvm-4a379c3dd8caeb265d0cb7dae347a0456ce85d84.zip
[WebAssembly] Use ArrayRef over raw pointers
Differential Revision: https://reviews.llvm.org/D42013 llvm-svn: 322423
Diffstat (limited to 'lld/wasm/Writer.cpp')
-rw-r--r--lld/wasm/Writer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index eea5439c2b9..bb34f265d40 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -770,8 +770,10 @@ void Writer::createCtorFunction() {
writeUleb128(OS, FunctionBody.size(), "function size");
OS.flush();
CtorFunctionBody += FunctionBody;
- CtorFunction =
- llvm::make_unique<SyntheticFunction>(Signature, CtorFunctionBody);
+ ArrayRef<uint8_t> BodyArray(
+ reinterpret_cast<const uint8_t *>(CtorFunctionBody.data()),
+ CtorFunctionBody.size());
+ CtorFunction = llvm::make_unique<SyntheticFunction>(Signature, BodyArray);
DefinedFunctions.emplace_back(CtorFunction.get());
}
OpenPOWER on IntegriCloud