sirit/src/insts/debug.cpp
2018-11-03 01:14:29 -03:00

29 lines
722 B
C++

/* This file is part of the sirit project.
* Copyright (c) 2018 ReinUsesLisp
* This software may be used and distributed according to the terms of the GNU
* Lesser General Public License version 2.1 or any later version.
*/
#include "op.h"
#include "sirit/sirit.h"
#include <memory>
#include <string>
namespace Sirit {
Id Module::Name(Id target, const std::string& name) {
auto op{std::make_unique<Op>(spv::Op::OpName)};
op->Add(target);
op->Add(name);
debug.push_back(std::move(op));
return target;
}
Id Module::OpString(const std::string& string) {
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
op->Add(string);
return AddCode(std::move(op));
}
} // namespace Sirit