summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCSymbolWasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCSymbolWasm.h')
-rw-r--r--include/llvm/MC/MCSymbolWasm.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/MC/MCSymbolWasm.h b/include/llvm/MC/MCSymbolWasm.h
index 7ea89629efda6..9bae6c582faa3 100644
--- a/include/llvm/MC/MCSymbolWasm.h
+++ b/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);
}
};