Add OpString

This commit is contained in:
ReinUsesLisp 2018-11-03 01:14:29 -03:00
parent d4c95981b5
commit 96e8290eef
2 changed files with 9 additions and 0 deletions

View file

@ -200,6 +200,9 @@ class Module {
/// @return target /// @return target
Id Name(Id target, const std::string& name); Id Name(Id target, const std::string& name);
/// Assign a Result <id> to a string for use by other debug instructions.
Id OpString(const std::string& string);
// Memory // Memory
/// Allocate an object in memory, resulting in a copy to it. /// Allocate an object in memory, resulting in a copy to it.

View file

@ -19,4 +19,10 @@ Id Module::Name(Id target, const std::string& name) {
return target; 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 } // namespace Sirit