Skip to content

[CodeGen] LiveIntervalUnions::Array Implement move constructor #111357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

optimisan
Copy link
Contributor

@optimisan optimisan commented Oct 7, 2024

Solves the double free error.

@optimisan optimisan marked this pull request as ready for review October 7, 2024 10:29
@llvmbot
Copy link
Member

llvmbot commented Oct 7, 2024

@llvm/pr-subscribers-llvm-regalloc

Author: Akshat Oke (Akshat-Oke)

Changes

Solves the double free error.


Full diff: https://github.com/llvm/llvm-project/pull/111357.diff

1 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/LiveIntervalUnion.h (+7)
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
index 81003455da4241..cc0f2a45bb182c 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
@@ -176,6 +176,13 @@ class LiveIntervalUnion {
     Array() = default;
     ~Array() { clear(); }
 
+    Array(Array &&Other) : Size(Other.Size), LIUs(Other.LIUs) {
+      Other.Size = 0;
+      Other.LIUs = nullptr;
+    }
+
+    Array(const Array &) = delete;
+
     // Initialize the array to have Size entries.
     // Reuse an existing allocation if the size matches.
     void init(LiveIntervalUnion::Allocator&, unsigned Size);

@optimisan optimisan requested a review from cdevadas October 7, 2024 16:38
@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from 7b68d9f to a1925ae Compare October 8, 2024 04:42
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from 15692bd to 47bb192 Compare October 8, 2024 04:46
@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from a1925ae to ca68507 Compare October 14, 2024 05:40
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from 47bb192 to dbc5187 Compare October 14, 2024 05:44
@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from ca68507 to db91ca0 Compare October 14, 2024 13:35
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from dbc5187 to 052c8b1 Compare October 14, 2024 13:35
@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from db91ca0 to dee5a29 Compare October 21, 2024 08:26
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from 052c8b1 to 709adf0 Compare October 21, 2024 08:26
@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from dee5a29 to 2cd5b9b Compare October 22, 2024 09:39
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from 709adf0 to c2a3cdc Compare October 22, 2024 09:39
@optimisan
Copy link
Contributor Author

optimisan commented Oct 22, 2024

Merge activity

  • Oct 22, 5:41 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 22, 5:51 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 22, 5:53 AM EDT: A user merged this pull request with Graphite.

@optimisan optimisan force-pushed the users/Akshat-Oke/update-dep branch from 2cd5b9b to 8dbbf81 Compare October 22, 2024 09:48
Base automatically changed from users/Akshat-Oke/update-dep to main October 22, 2024 09:50
@optimisan optimisan force-pushed the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch from c2a3cdc to c6b5910 Compare October 22, 2024 09:51
@optimisan optimisan merged commit 75ec65e into main Oct 22, 2024
4 of 5 checks passed
@optimisan optimisan deleted the users/Akshat-Oke/10-07-_codegen_liveintervalunions_array_implement_move_constructor branch October 22, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants