luau/CodeGen/include/Luau/IrDump.h

42 lines
1.1 KiB
C
Raw Normal View History

2023-01-13 12: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 14:34:12 +02:00
#include "Luau/IrData.h"
2023-01-13 12:36:28 -08:00
#include <string>
#include <vector>
namespace Luau
{
namespace CodeGen
{
2023-03-10 11:20:04 -08:00
struct CfgInfo;
2023-01-13 12:36:28 -08:00
const char* getCmdName(IrCmd cmd);
const char* getBlockKindName(IrBlockKind kind);
struct IrToStringContext
{
std::string& result;
std::vector<IrBlock>& blocks;
std::vector<IrConst>& constants;
2023-03-10 11:20:04 -08:00
CfgInfo& cfg;
2023-01-13 12:36:28 -08:00
};
2023-02-10 10:50:54 -08:00
void toString(IrToStringContext& ctx, const IrInst& inst, uint32_t index);
void toString(IrToStringContext& ctx, const IrBlock& block, uint32_t index); // Block title
2023-01-13 12:36:28 -08:00
void toString(IrToStringContext& ctx, IrOp op);
void toString(std::string& result, IrConst constant);
2023-03-10 11:20:04 -08:00
void toStringDetailed(IrToStringContext& ctx, const IrInst& inst, uint32_t index, bool includeUseInfo);
void toStringDetailed(IrToStringContext& ctx, const IrBlock& block, uint32_t index, bool includeUseInfo); // Block title
2023-02-10 10:50:54 -08:00
2023-03-10 11:20:04 -08:00
std::string toString(IrFunction& function, bool includeUseInfo);
2023-01-13 12:36:28 -08:00
2023-01-20 14:02:39 +02:00
std::string dump(IrFunction& function);
2023-01-13 12:36:28 -08:00
} // namespace CodeGen
} // namespace Luau