mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
29047504da
Some checks failed
benchmark / callgrind (map[branch:main name:luau-lang/benchmark-data], ubuntu-22.04) (push) Has been cancelled
build / macos (push) Has been cancelled
build / macos-arm (push) Has been cancelled
build / ubuntu (push) Has been cancelled
build / windows (Win32) (push) Has been cancelled
build / windows (x64) (push) Has been cancelled
build / coverage (push) Has been cancelled
build / web (push) Has been cancelled
release / macos (push) Has been cancelled
release / ubuntu (push) Has been cancelled
release / windows (push) Has been cancelled
release / web (push) Has been cancelled
## General - Fix a parsing bug related to the starting position of function names. - Rename Luau's `Table` struct to `LuaTable`. ## New Solver - Add support for generics in user-defined type functions ([RFC](https://rfcs.luau.org/support-for-generic-function-types-in-user-defined-type-functions.html)). - Provide a definition of `math.lerp` to the typechecker. - Implement error suppression in `string.format`. - Fixes #1587. - Ensure function call discriminant types are always filled when resolving `FunctionCallConstraint`. --- Co-authored-by: Ariel Weiss <aaronweiss@roblox.com> Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com> Co-authored-by: Talha Pathan <tpathan@roblox.com> Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
69 lines
1.8 KiB
C++
69 lines
1.8 KiB
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include "Luau/IrData.h"
|
|
#include "Luau/CodeGenOptions.h"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct Proto;
|
|
|
|
namespace Luau
|
|
{
|
|
namespace CodeGen
|
|
{
|
|
|
|
struct CfgInfo;
|
|
|
|
const char* getCmdName(IrCmd cmd);
|
|
const char* getBlockKindName(IrBlockKind kind);
|
|
|
|
struct IrToStringContext
|
|
{
|
|
std::string& result;
|
|
const std::vector<IrBlock>& blocks;
|
|
const std::vector<IrConst>& constants;
|
|
const CfgInfo& cfg;
|
|
Proto* proto = nullptr;
|
|
};
|
|
|
|
void toString(IrToStringContext& ctx, const IrInst& inst, uint32_t index);
|
|
void toString(IrToStringContext& ctx, const IrBlock& block, uint32_t index); // Block title
|
|
void toString(IrToStringContext& ctx, IrOp op);
|
|
|
|
void toString(std::string& result, IrConst constant);
|
|
|
|
const char* getBytecodeTypeName(uint8_t type, const char* const* userdataTypes);
|
|
|
|
void toString(std::string& result, const BytecodeTypes& bcTypes, const char* const* userdataTypes);
|
|
|
|
void toStringDetailed(
|
|
IrToStringContext& ctx,
|
|
const IrBlock& block,
|
|
uint32_t blockIdx,
|
|
const IrInst& inst,
|
|
uint32_t instIdx,
|
|
IncludeUseInfo includeUseInfo
|
|
);
|
|
void toStringDetailed(
|
|
IrToStringContext& ctx,
|
|
const IrBlock& block,
|
|
uint32_t blockIdx,
|
|
IncludeUseInfo includeUseInfo,
|
|
IncludeCfgInfo includeCfgInfo,
|
|
IncludeRegFlowInfo includeRegFlowInfo
|
|
);
|
|
|
|
std::string toString(const IrFunction& function, IncludeUseInfo includeUseInfo);
|
|
|
|
std::string dump(const IrFunction& function);
|
|
|
|
std::string toDot(const IrFunction& function, bool includeInst);
|
|
std::string toDotCfg(const IrFunction& function);
|
|
std::string toDotDjGraph(const IrFunction& function);
|
|
|
|
std::string dumpDot(const IrFunction& function, bool includeInst);
|
|
|
|
} // namespace CodeGen
|
|
} // namespace Luau
|