Files
sirit/src/insts/debug.cpp

29 lines
722 B
C++
Raw Normal View History

2018-08-31 04:40:15 -03:00
/* 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>
2018-08-31 04:40:15 -03:00
namespace Sirit {
2018-10-31 22:20:49 -03:00
Id Module::Name(Id target, const std::string& name) {
auto op{std::make_unique<Op>(spv::Op::OpName)};
2018-08-31 04:40:15 -03:00
op->Add(target);
op->Add(name);
debug.push_back(std::move(op));
2018-08-31 04:55:01 -03:00
return target;
2018-08-31 04:40:15 -03:00
}
2018-11-03 01:14:29 -03:00
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));
}
2018-08-31 04:40:15 -03:00
} // namespace Sirit