mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 22:35:43 +08:00
33 lines
730 B
C
33 lines
730 B
C
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||
|
#pragma once
|
||
|
|
||
|
#include "IrData.h"
|
||
|
|
||
|
#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);
|
||
|
|
||
|
} // namespace CodeGen
|
||
|
} // namespace Luau
|