2022-01-14 16:06:31 +00:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ValueTracking.h"
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
struct CompileOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
namespace Compile
|
|
|
|
{
|
|
|
|
|
|
|
|
struct Builtin
|
|
|
|
{
|
|
|
|
AstName object;
|
|
|
|
AstName method;
|
|
|
|
|
|
|
|
bool empty() const
|
|
|
|
{
|
|
|
|
return object == AstName() && method == AstName();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isGlobal(const char* name) const
|
|
|
|
{
|
|
|
|
return object == AstName() && method == name;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isMethod(const char* table, const char* name) const
|
|
|
|
{
|
|
|
|
return object == table && method == name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Builtin getBuiltin(AstExpr* node, const DenseHashMap<AstName, Global>& globals, const DenseHashMap<AstLocal*, Variable>& variables);
|
2022-07-14 23:39:35 +01:00
|
|
|
|
|
|
|
void analyzeBuiltins(DenseHashMap<AstExprCall*, int>& result, const DenseHashMap<AstName, Global>& globals,
|
|
|
|
const DenseHashMap<AstLocal*, Variable>& variables, const CompileOptions& options, AstNode* root);
|
2022-01-14 16:06:31 +00:00
|
|
|
|
|
|
|
} // namespace Compile
|
|
|
|
} // namespace Luau
|