diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
| -rw-r--r-- | gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index a60b10fc530..4be4beb85d0 100644 --- a/gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/gnu/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h @@ -17,7 +17,9 @@ #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H #include "MCTargetDesc/WebAssemblyMCTargetDesc.h" +#include "llvm/BinaryFormat/Wasm.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/MC/MCSymbolWasm.h" namespace llvm { @@ -50,7 +52,7 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { // overaligned values on the user stack. unsigned BasePtrVreg = -1U; - public: +public: explicit WebAssemblyFunctionInfo(MachineFunction &MF) : MF(MF) {} ~WebAssemblyFunctionInfo() override; @@ -60,7 +62,10 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { void addResult(MVT VT) { Results.push_back(VT); } const std::vector<MVT> &getResults() const { return Results; } - void clearParamsAndResults() { Params.clear(); Results.clear(); } + void clearParamsAndResults() { + Params.clear(); + Results.clear(); + } void setNumLocals(size_t NumLocals) { Locals.resize(NumLocals, MVT::i32); } void setLocal(size_t i, MVT VT) { Locals[i] = VT; } @@ -115,13 +120,22 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { } }; -void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM, - Type *Ty, SmallVectorImpl<MVT> &ValueVTs); +void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM, Type *Ty, + SmallVectorImpl<MVT> &ValueVTs); -void ComputeSignatureVTs(const Function &F, const TargetMachine &TM, - SmallVectorImpl<MVT> &Params, +// Compute the signature for a given FunctionType (Ty). Note that it's not the +// signature for F (F is just used to get varous context) +void ComputeSignatureVTs(const FunctionType *Ty, const Function &F, + const TargetMachine &TM, SmallVectorImpl<MVT> &Params, SmallVectorImpl<MVT> &Results); +void ValTypesFromMVTs(const ArrayRef<MVT> &In, + SmallVectorImpl<wasm::ValType> &Out); + +std::unique_ptr<wasm::WasmSignature> +SignatureFromMVTs(const SmallVectorImpl<MVT> &Results, + const SmallVectorImpl<MVT> &Params); + } // end namespace llvm #endif |
