Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/binaryen-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,8 @@ const char* BinaryenExportGetValue(BinaryenExportRef export_);
// General usage is (1) create a relooper, (2) create blocks, (3) add
// branches between them, (4) render the output.
//
// See Relooper.h for more details
// For more details, see src/cfg/Relooper.h and
// https://github.com/WebAssembly/binaryen/wiki/Compiling-to-WebAssembly-with-Binaryen#cfg-api

typedef void* RelooperRef;
typedef void* RelooperBlockRef;
Expand Down
4 changes: 4 additions & 0 deletions src/cfg/Relooper.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ struct Block {
// Add a branch: if the condition holds we branch (or if null, we branch if all others failed)
// Note that there can be only one branch from A to B (if you need multiple conditions for the branch,
// create a more interesting expression in the Condition).
// If a Block has no outgoing branches, the contents in Code must contain a terminating
// instruction, as the relooper doesn't know whether you want control flow to stop with
// an `unreachable` or a `return` or something else (if you forget to do this, control
// flow may continue into the block that happens to be emitted right after it).
void AddBranchTo(Block *Target, wasm::Expression* Condition, wasm::Expression* Code = nullptr);

// Add a switch branch: if the switch condition is one of these values, we branch (or if the list is empty, we are the default)
Expand Down
2 changes: 1 addition & 1 deletion src/wasm-binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ class WasmBinaryWriter : public Visitor<WasmBinaryWriter, void> {
// AST writing via visitors
int depth = 0; // only for debugging

void recurse(Expression*& curr);
void recurse(Expression* curr);
std::vector<Name> breakStack;
Function::DebugLocation lastDebugLocation;
size_t lastBytecodeOffset;
Expand Down
Loading