Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/CodeGen/include/Luau/IrDump.h
2727 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
#pragma once
3
4
#include "Luau/IrData.h"
5
#include "Luau/CodeGenOptions.h"
6
7
#include <string>
8
#include <vector>
9
10
struct Proto;
11
12
namespace Luau
13
{
14
namespace CodeGen
15
{
16
17
struct CfgInfo;
18
19
const char* getCmdName(IrCmd cmd);
20
const char* getBlockKindName(IrBlockKind kind);
21
22
struct IrToStringContext
23
{
24
std::string& result;
25
const std::vector<IrBlock>& blocks;
26
const std::vector<IrConst>& constants;
27
const CfgInfo& cfg;
28
Proto* proto = nullptr;
29
};
30
31
void toString(IrToStringContext& ctx, const IrInst& inst, uint32_t index);
32
void toString(IrToStringContext& ctx, const IrBlock& block, uint32_t index); // Block title
33
void toString(IrToStringContext& ctx, IrOp op);
34
35
void toString(std::string& result, Proto* proto, IrConst constant);
36
37
const char* getBytecodeTypeName(uint8_t type, const char* const* userdataTypes);
38
39
void toString(std::string& result, const BytecodeTypes& bcTypes, const char* const* userdataTypes);
40
41
void toStringDetailed(IrToStringContext& ctx, const IrBlock& block, uint32_t blockIdx, IrInst& inst, uint32_t instIdx, IncludeUseInfo includeUseInfo);
42
void toStringDetailed(
43
IrToStringContext& ctx,
44
const IrBlock& block,
45
uint32_t blockIdx,
46
IncludeUseInfo includeUseInfo,
47
IncludeCfgInfo includeCfgInfo,
48
IncludeRegFlowInfo includeRegFlowInfo
49
);
50
51
std::string toString(IrFunction& function, IncludeUseInfo includeUseInfo);
52
53
std::string dump(IrFunction& function);
54
55
std::string toDot(const IrFunction& function, bool includeInst);
56
std::string toDotCfg(const IrFunction& function);
57
std::string toDotDjGraph(const IrFunction& function);
58
59
std::string dumpDot(const IrFunction& function, bool includeInst);
60
61
} // namespace CodeGen
62
} // namespace Luau
63
64