diff options
| author | Sam Clegg <sbc@chromium.org> | 2017-07-05 20:25:08 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2017-07-05 20:25:08 +0000 |
| commit | 9bf73c078b9a6a0bea5bf044e5ff9f8df18dc81a (patch) | |
| tree | 303dd195de437b4b875aed71de1f3c4e43d5d1df /llvm/include | |
| parent | bb33f570455e7017a18f2ff6e3d2383b211f7e3d (diff) | |
| download | bcm5719-llvm-9bf73c078b9a6a0bea5bf044e5ff9f8df18dc81a.tar.gz bcm5719-llvm-9bf73c078b9a6a0bea5bf044e5ff9f8df18dc81a.zip | |
[WebAssembly] Fix types for address taken functions
Differential Revision: https://reviews.llvm.org/D34966
llvm-svn: 307198
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/MC/MCSymbolWasm.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/include/llvm/MC/MCSymbolWasm.h b/llvm/include/llvm/MC/MCSymbolWasm.h index 7ea89629efd..9bae6c582fa 100644 --- a/llvm/include/llvm/MC/MCSymbolWasm.h +++ b/llvm/include/llvm/MC/MCSymbolWasm.h @@ -21,6 +21,8 @@ private: std::string ModuleName; SmallVector<wasm::ValType, 1> Returns; SmallVector<wasm::ValType, 4> Params; + bool ParamsSet = false; + bool ReturnsSet = false; /// An expression describing how to calculate the size of a symbol. If a /// symbol has no size this field will be NULL. @@ -45,15 +47,23 @@ public: const StringRef getModuleName() const { return ModuleName; } - const SmallVector<wasm::ValType, 1> &getReturns() const { return Returns; } + const SmallVector<wasm::ValType, 1> &getReturns() const { + assert(ReturnsSet); + return Returns; + } void setReturns(SmallVectorImpl<wasm::ValType> &&Rets) { + ReturnsSet = true; Returns = std::move(Rets); } - const SmallVector<wasm::ValType, 4> &getParams() const { return Params; } + const SmallVector<wasm::ValType, 4> &getParams() const { + assert(ParamsSet); + return Params; + } void setParams(SmallVectorImpl<wasm::ValType> &&Pars) { + ParamsSet = true; Params = std::move(Pars); } }; |

