luau/CodeGen/include/Luau/IrDump.h

35 lines
776 B
C
Raw Normal View History

2023-01-14 04:36:28 +08:00
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#pragma once
2023-02-03 20:34:12 +08:00
#include "Luau/IrData.h"
2023-01-14 04:36:28 +08:00
#include <string>
#include <vector>
namespace Luau
{
namespace CodeGen
{
const char* getCmdName(IrCmd cmd);
const char* getBlockKindName(IrBlockKind kind);
struct IrToStringContext
{
std::string& result;
std::vector<IrBlock>& blocks;
std::vector<IrConst>& constants;
};
void toString(IrToStringContext& ctx, IrInst inst, uint32_t index);
void toString(IrToStringContext& ctx, IrOp op);
void toString(std::string& result, IrConst constant);
void toStringDetailed(IrToStringContext& ctx, IrInst inst, uint32_t index);
2023-01-20 20:02:39 +08:00
std::string dump(IrFunction& function);
2023-01-14 04:36:28 +08:00
} // namespace CodeGen
} // namespace Luau