diff options
author | Derek Schuff <dschuff@google.com> | 2018-10-03 22:22:48 +0000 |
---|---|---|
committer | Derek Schuff <dschuff@google.com> | 2018-10-03 22:22:48 +0000 |
commit | 77a7a38006eed3dda8f63b1a352f3f60398bda41 (patch) | |
tree | feb6080c3570ffc594004af3e1514a1bfa55fd12 /llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | |
parent | 3ed33eade06d583f2a93fe253975bc07a39fbd9e (diff) | |
download | llvm-77a7a38006eed3dda8f63b1a352f3f60398bda41.zip llvm-77a7a38006eed3dda8f63b1a352f3f60398bda41.tar.gz llvm-77a7a38006eed3dda8f63b1a352f3f60398bda41.tar.bz2 |
[WebAssembly] Refactor WasmSignature and use it for MCSymbolWasm
MCContext does not destroy MCSymbols on shutdown. So, rather than putting
SmallVectors (which may heap-allocate) inside MCSymbolWasm, use unowned pointer
to a WasmSignature instead. The signatures are now owned by the AsmPrinter.
Also uses WasmSignature instead of param and result vectors in TargetStreamer,
and leaves some TODOs for further simplification.
Differential Revision: https://reviews.llvm.org/D52580
llvm-svn: 343733
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index 5a2602f..cde44d2 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/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 { @@ -121,10 +123,16 @@ public: 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); +std::unique_ptr<wasm::WasmSignature> +SignatureFromMVTs(const SmallVectorImpl<MVT> &Results, + const SmallVectorImpl<MVT> &Params); + } // end namespace llvm #endif |