mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Allow setting the namer into the inspector.
This CL adds an extra constructor to the inspector to change the namer user. The inspector tests are then updated to use the test namer. Change-Id: Ibc91de89b52161dc125b38d65e445b5833ad6c18 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36943 Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
dan sinclair
parent
b920e604b2
commit
a8d9755053
@@ -43,10 +43,18 @@
|
||||
namespace tint {
|
||||
namespace inspector {
|
||||
|
||||
Inspector::Inspector(ast::Module& module)
|
||||
: module_(module), namer_(std::make_unique<UnsafeNamer>(&module)) {}
|
||||
Inspector::Inspector(ast::Module& module, Namer* namer)
|
||||
: module_(module), namer_(namer), namer_is_owned_(false) {}
|
||||
|
||||
Inspector::~Inspector() = default;
|
||||
Inspector::Inspector(ast::Module& module)
|
||||
: module_(module),
|
||||
namer_(new UnsafeNamer(&module)),
|
||||
namer_is_owned_(true) {}
|
||||
|
||||
Inspector::~Inspector() {
|
||||
if (namer_is_owned_)
|
||||
delete namer_;
|
||||
}
|
||||
|
||||
std::vector<EntryPoint> Inspector::GetEntryPoints() {
|
||||
std::vector<EntryPoint> result;
|
||||
|
||||
Reference in New Issue
Block a user