Definition at line 202 of file Print.cpp.
◆ Result
◆ FunctionPrintContext()
WAST::FunctionPrintContext::FunctionPrintContext |
( |
ModulePrintContext & | inModuleContext, |
|
|
Uptr | functionDefIndex ) |
|
inline |
Definition at line 215 of file Print.cpp.
217 ,
module(inModuleContext.module)
218 ,
functionDef(inModuleContext.module.functions.defs[functionDefIndex])
220 ,
string(inModuleContext.string)
223 {}
IndexSpace< FunctionDef, IndexedFunctionType > functions
const std::vector< std::string > & localNames
ModulePrintContext & moduleContext
const FunctionType * functionType
const FunctionDef & functionDef
◆ block()
Definition at line 231 of file Print.cpp.
232 {
233 string += "\nblock";
234 pushControlStack(ControlContext::Type::block,"block");
236 }
void printControlSignature(std::string &string, ResultType resultType)
◆ br()
void WAST::FunctionPrintContext::br |
( |
BranchImm | imm | ) |
|
|
inline |
Definition at line 268 of file Print.cpp.
269 {
270 string +=
"\nbr " + getBranchTargetId(imm.
targetDepth);
271 enterUnreachable();
272 }
◆ br_if()
void WAST::FunctionPrintContext::br_if |
( |
BranchImm | imm | ) |
|
|
inline |
Definition at line 291 of file Print.cpp.
292 {
293 string +=
"\nbr_if " + getBranchTargetId(imm.
targetDepth);
294 }
◆ br_table()
Definition at line 273 of file Print.cpp.
274 {
276 enum { numTargetsPerLine = 16 };
279 for(
Uptr targetIndex = 0;targetIndex < targetDepths.size();++targetIndex)
280 {
281 if(targetIndex % numTargetsPerLine == 0) { string += '\n'; }
282 else { string += ' '; }
283 string += getBranchTargetId(targetDepths[targetIndex]);
284 }
285 string += '\n';
288
289 enterUnreachable();
290 }
PointerIntHelper< sizeof(size_t)>::UnsignedIntType Uptr
#define WAVM_ASSERT_THROW(cond)
std::vector< std::vector< U32 > > branchTables
◆ call()
void WAST::FunctionPrintContext::call |
( |
CallImm | imm | ) |
|
|
inline |
Definition at line 326 of file Print.cpp.
327 {
329 }
std::vector< Function > functions
◆ call_indirect()
Definition at line 330 of file Print.cpp.
331 {
333 }
std::vector< std::string > types
◆ drop()
void WAST::FunctionPrintContext::drop |
( |
NoImm | | ) |
|
|
inline |
Definition at line 297 of file Print.cpp.
297{ string += "\ndrop"; }
◆ else_()
void WAST::FunctionPrintContext::else_ |
( |
NoImm | imm | ) |
|
|
inline |
Definition at line 249 of file Print.cpp.
250 {
252 controlStack.back().type = ControlContext::Type::ifElse;
254 }
◆ end()
void WAST::FunctionPrintContext::end |
( |
NoImm | | ) |
|
|
inline |
Definition at line 255 of file Print.cpp.
256 {
258 if(controlStack.back().type != ControlContext::Type::function) { string += "\nend ;; "; string += controlStack.back().labelId; }
259 controlStack.pop_back();
260 }
◆ get_global()
Definition at line 317 of file Print.cpp.
318 {
320 }
std::vector< std::string > globals
◆ get_local()
◆ if_()
Definition at line 243 of file Print.cpp.
244 {
245 string += "\nif";
246 pushControlStack(ControlContext::Type::ifThen,"if");
248 }
◆ loop()
Definition at line 237 of file Print.cpp.
238 {
239 string += "\nloop";
240 pushControlStack(ControlContext::Type::loop,"loop");
242 }
◆ printFunctionBody()
void WAST::FunctionPrintContext::printFunctionBody |
( |
| ) |
|
Definition at line 672 of file Print.cpp.
673 {
674
675 pushControlStack(ControlContext::Type::function,nullptr);
677
679 while(decoder && controlStack.size())
680 {
681 decoder.decodeOp(*this);
682 };
683
685 }
◆ printImm() [1/7]
void WAST::FunctionPrintContext::printImm |
( |
LiteralImm< F32 > | imm | ) |
|
|
inline |
Definition at line 340 of file Print.cpp.
std::string asString(Float f)
◆ printImm() [2/7]
void WAST::FunctionPrintContext::printImm |
( |
LiteralImm< F64 > | imm | ) |
|
|
inline |
◆ printImm() [3/7]
void WAST::FunctionPrintContext::printImm |
( |
LiteralImm< I32 > | imm | ) |
|
|
inline |
Definition at line 338 of file Print.cpp.
338{
string +=
' ';
string += std::to_string(imm.
value); }
◆ printImm() [4/7]
void WAST::FunctionPrintContext::printImm |
( |
LiteralImm< I64 > | imm | ) |
|
|
inline |
Definition at line 339 of file Print.cpp.
339{
string +=
' ';
string += std::to_string(imm.
value); }
◆ printImm() [5/7]
template<
Uptr naturalAlignmentLog2>
void WAST::FunctionPrintContext::printImm |
( |
LoadOrStoreImm< naturalAlignmentLog2 > | imm | ) |
|
|
inline |
Definition at line 344 of file Print.cpp.
345 {
347 {
348 string += " offset=";
349 string += std::to_string(imm.
offset);
350 }
352 {
353 string += " align=";
355 }
356 }
◆ printImm() [6/7]
void WAST::FunctionPrintContext::printImm |
( |
MemoryImm | | ) |
|
|
inline |
◆ printImm() [7/7]
void WAST::FunctionPrintContext::printImm |
( |
NoImm | | ) |
|
|
inline |
◆ return_()
void WAST::FunctionPrintContext::return_ |
( |
NoImm | | ) |
|
|
inline |
Definition at line 262 of file Print.cpp.
263 {
264 string += "\nreturn";
265 enterUnreachable();
266 }
◆ select()
void WAST::FunctionPrintContext::select |
( |
NoImm | | ) |
|
|
inline |
Definition at line 299 of file Print.cpp.
300 {
301 string += "\nselect";
302 }
◆ set_global()
◆ set_local()
◆ tee_local()
◆ unknown()
void WAST::FunctionPrintContext::unknown |
( |
Opcode | | ) |
|
|
inline |
◆ unreachable()
void WAST::FunctionPrintContext::unreachable |
( |
NoImm | | ) |
|
|
inline |
Definition at line 296 of file Print.cpp.
296{ string += "\nunreachable"; enterUnreachable(); }
◆ functionDef
const FunctionDef& WAST::FunctionPrintContext::functionDef |
◆ functionType
const FunctionType* WAST::FunctionPrintContext::functionType |
◆ labelNameScope
NameScope WAST::FunctionPrintContext::labelNameScope |
◆ localNames
const std::vector<std::string>& WAST::FunctionPrintContext::localNames |
◆ module
const Module& WAST::FunctionPrintContext::module |
◆ moduleContext
◆ string
std::string& WAST::FunctionPrintContext::string |
The documentation for this struct was generated from the following file: