}
yaml::WebAssemblyFunctionInfo::WebAssemblyFunctionInfo(
- const llvm::WebAssemblyFunctionInfo &MFI) {}
+ const llvm::WebAssemblyFunctionInfo &MFI)
+ : CFGStackified(MFI.isCFGStackified()) {}
void yaml::WebAssemblyFunctionInfo::mappingImpl(yaml::IO &YamlIO) {
MappingTraits<WebAssemblyFunctionInfo>::mapping(YamlIO, *this);
}
void WebAssemblyFunctionInfo::initializeBaseYamlFields(
- const yaml::WebAssemblyFunctionInfo &YamlMFI) {}
+ const yaml::WebAssemblyFunctionInfo &YamlMFI) {
+ CFGStackified = YamlMFI.CFGStackified;
+}
// overaligned values on the user stack.
unsigned BasePtrVreg = -1U;
+ // Function properties.
+ bool CFGStackified = false;
+
public:
explicit WebAssemblyFunctionInfo(MachineFunction &MF) : MF(MF) {}
~WebAssemblyFunctionInfo() override;
assert(Reg & INT32_MIN);
return Reg & INT32_MAX;
}
+
+ bool isCFGStackified() const { return CFGStackified; }
+ void setCFGStackified(bool Value = true) { CFGStackified = Value; }
};
void computeLegalValueVTs(const Function &F, const TargetMachine &TM, Type *Ty,
namespace yaml {
struct WebAssemblyFunctionInfo final : public yaml::MachineFunctionInfo {
+ bool CFGStackified = false;
+
WebAssemblyFunctionInfo() = default;
WebAssemblyFunctionInfo(const llvm::WebAssemblyFunctionInfo &MFI);
};
template <> struct MappingTraits<WebAssemblyFunctionInfo> {
- static void mapping(IO &YamlIO, WebAssemblyFunctionInfo &MFI) {}
+ static void mapping(IO &YamlIO, WebAssemblyFunctionInfo &MFI) {
+ YamlIO.mapOptional("isCFGStackified", MFI.CFGStackified, false);
+ }
};
} // end namespace yaml
# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
# CHECK-LABEL: function_property_test
-# CHECK: machineFunctionInfo: {}
+# CHECK: machineFunctionInfo:
+# CHECK: isCFGStackified: true
name: function_property_test
liveins:
- { reg: '$arguments' }