Skip to content
Snippets Groups Projects
Commit 0366c18d authored by Fernando Sahmkow's avatar Fernando Sahmkow Committed by FernandoS27
Browse files

Shader_IR: mark labels as unused for partial decompile.

parent 47e4f6a5
No related branches found
No related tags found
No related merge requests found
...@@ -497,9 +497,7 @@ void ASTManager::Decompile() { ...@@ -497,9 +497,7 @@ void ASTManager::Decompile() {
} }
} }
if (can_remove) { if (can_remove) {
auto& manager = label->GetManager(); label->MarkLabelUnused();
manager.Remove(label);
labels.erase(it);
} }
} }
} }
......
...@@ -112,6 +112,7 @@ class ASTLabel { ...@@ -112,6 +112,7 @@ class ASTLabel {
public: public:
ASTLabel(u32 index) : index{index} {} ASTLabel(u32 index) : index{index} {}
u32 index; u32 index;
bool unused{};
}; };
class ASTGoto { class ASTGoto {
...@@ -204,6 +205,13 @@ public: ...@@ -204,6 +205,13 @@ public:
return nullptr; return nullptr;
} }
void MarkLabelUnused() const {
auto inner = std::get_if<ASTLabel>(&data);
if (inner) {
inner->unused = true;
}
}
Expr GetIfCondition() const { Expr GetIfCondition() const {
auto inner = std::get_if<ASTIfThen>(&data); auto inner = std::get_if<ASTIfThen>(&data);
if (inner) { if (inner) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment