1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 04:10:06 +00:00
OpenMW/components/compiler/output.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.1 KiB
C++
Raw Normal View History

#include "output.hpp"
#include <algorithm>
#include <cassert>
#include <iterator>
#include "locals.hpp"
namespace Compiler
{
Output::Output(Locals& locals)
: mLocals(locals)
{
}
Interpreter::Program Output::getProgram() const
{
return Interpreter::Program{
.mInstructions = mCode,
.mIntegers = mLiterals.getIntegers(),
.mFloats = mLiterals.getFloats(),
.mStrings = mLiterals.getStrings(),
};
}
const Literals& Output::getLiterals() const
{
return mLiterals;
}
2022-09-22 18:26:05 +00:00
const std::vector<Interpreter::Type_Code>& Output::getCode() const
{
return mCode;
}
2022-09-22 18:26:05 +00:00
const Locals& Output::getLocals() const
{
return mLocals;
}
Literals& Output::getLiterals()
{
return mLiterals;
}
2022-09-22 18:26:05 +00:00
std::vector<Interpreter::Type_Code>& Output::getCode()
{
return mCode;
}
2022-09-22 18:26:05 +00:00
Locals& Output::getLocals()
{
return mLocals;
}
2022-09-22 18:26:05 +00:00
void Output::clear()
{
mLiterals.clear();
mCode.clear();
mLocals.clear();
}
}