diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-10-06 22:29:32 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-10-06 22:29:32 +0000 |
commit | 2726b88c038737460a4502915ff427db5854b3e7 (patch) | |
tree | 4c4ad476a660cea533b0fa28b41d701e4f6adece /llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | |
parent | 3a643e8d46d06da4c6648a12e48ceb6ab6dc3733 (diff) | |
download | bcm5719-llvm-2726b88c038737460a4502915ff427db5854b3e7.tar.gz bcm5719-llvm-2726b88c038737460a4502915ff427db5854b3e7.zip |
[WebAssemby] Implement block signatures.
Per spec changes, this implements block signatures, and adds just enough
logic to produce correct block signatures at the ends of functions.
Differential Revision: https://reviews.llvm.org/D25144
llvm-svn: 283503
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index 89f607d84b7..86693a933ec 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h @@ -27,6 +27,7 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { MachineFunction &MF; std::vector<MVT> Params; + std::vector<MVT> Results; /// A mapping from CodeGen vreg index to WebAssembly register number. std::vector<unsigned> WARegs; @@ -51,6 +52,9 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { void addParam(MVT VT) { Params.push_back(VT); } const std::vector<MVT> &getParams() const { return Params; } + void addResult(MVT VT) { Results.push_back(VT); } + const std::vector<MVT> &getResults() const { return Results; } + unsigned getVarargBufferVreg() const { assert(VarargVreg != -1U && "Vararg vreg hasn't been set"); return VarargVreg; @@ -88,6 +92,13 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { } }; +void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM, + Type *Ty, SmallVectorImpl<MVT> &ValueVTs); + +void ComputeSignatureVTs(const Function &F, const TargetMachine &TM, + SmallVectorImpl<MVT> &Params, + SmallVectorImpl<MVT> &Results); + } // end namespace llvm #endif |