mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-23 16:21:22 -08:00
video_core/ast: Default the move constructor and assignment operator
This is behaviorally equivalent and also fixes a bug where some members weren't being moved over.
This commit is contained in:
parent
43503a69bf
commit
3a20d9734f
@ -374,30 +374,6 @@ void ASTManager::Init() {
|
|||||||
false_condition = MakeExpr<ExprBoolean>(false);
|
false_condition = MakeExpr<ExprBoolean>(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASTManager::ASTManager(ASTManager&& other) noexcept
|
|
||||||
: labels_map(std::move(other.labels_map)), labels_count{other.labels_count},
|
|
||||||
gotos(std::move(other.gotos)), labels(std::move(other.labels)), variables{other.variables},
|
|
||||||
program{other.program}, main_node{other.main_node}, false_condition{other.false_condition},
|
|
||||||
disable_else_derivation{other.disable_else_derivation} {
|
|
||||||
other.main_node.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
ASTManager& ASTManager::operator=(ASTManager&& other) noexcept {
|
|
||||||
full_decompile = other.full_decompile;
|
|
||||||
labels_map = std::move(other.labels_map);
|
|
||||||
labels_count = other.labels_count;
|
|
||||||
gotos = std::move(other.gotos);
|
|
||||||
labels = std::move(other.labels);
|
|
||||||
variables = other.variables;
|
|
||||||
program = other.program;
|
|
||||||
main_node = other.main_node;
|
|
||||||
false_condition = other.false_condition;
|
|
||||||
disable_else_derivation = other.disable_else_derivation;
|
|
||||||
|
|
||||||
other.main_node.reset();
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ASTManager::DeclareLabel(u32 address) {
|
void ASTManager::DeclareLabel(u32 address) {
|
||||||
const auto pair = labels_map.emplace(address, labels_count);
|
const auto pair = labels_map.emplace(address, labels_count);
|
||||||
if (pair.second) {
|
if (pair.second) {
|
||||||
|
@ -313,8 +313,8 @@ public:
|
|||||||
ASTManager(const ASTManager& o) = delete;
|
ASTManager(const ASTManager& o) = delete;
|
||||||
ASTManager& operator=(const ASTManager& other) = delete;
|
ASTManager& operator=(const ASTManager& other) = delete;
|
||||||
|
|
||||||
ASTManager(ASTManager&& other) noexcept;
|
ASTManager(ASTManager&& other) noexcept = default;
|
||||||
ASTManager& operator=(ASTManager&& other) noexcept;
|
ASTManager& operator=(ASTManager&& other) noexcept = default;
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user