mirror of
https://github.com/yuzu-emu/sirit
synced 2024-11-22 22:43:55 +00:00
Debug fixups
This commit is contained in:
parent
96e8290eef
commit
65ccda50c7
2 changed files with 15 additions and 2 deletions
|
@ -201,7 +201,10 @@ class Module {
|
||||||
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.
|
/// Assign a Result <id> to a string for use by other debug instructions.
|
||||||
Id OpString(const std::string& string);
|
Id String(const std::string& string);
|
||||||
|
|
||||||
|
/// Add source-level location information
|
||||||
|
Id OpLine(Id file, Literal line, Literal column);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,19 @@ Id Module::Name(Id target, const std::string& name) {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
Id Module::OpString(const std::string& string) {
|
Id Module::String(const std::string& string) {
|
||||||
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
|
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
|
||||||
op->Add(string);
|
op->Add(string);
|
||||||
|
const auto id = op.get();
|
||||||
|
debug.push_back(std::move(op));
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
Id Module::OpLine(Id file, Literal line, Literal column) {
|
||||||
|
auto op{std::make_unique<Op>(spv::Op::OpLine)};
|
||||||
|
op->Add(file);
|
||||||
|
op->Add(line);
|
||||||
|
op->Add(column);
|
||||||
return AddCode(std::move(op));
|
return AddCode(std::move(op));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue