-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Revert "Fix pointer to reference type (#113596)" #114831
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 25909b8 due to unresolved questions about the behavior of "frame var" and ValueObject in the presence of references (see the original patch for discussion).
@llvm/pr-subscribers-lldb Author: Pavel Labath (labath) ChangesThis reverts commit 25909b8 due to unresolved questions about the behavior of "frame var" and ValueObject in the presence of references (see the original patch for discussion). Full diff: https://github.com/llvm/llvm-project/pull/114831.diff 3 Files Affected:
diff --git a/lldb/source/ValueObject/ValueObject.cpp b/lldb/source/ValueObject/ValueObject.cpp
index aca43175d12fac..4006f6e6fd0a5e 100644
--- a/lldb/source/ValueObject/ValueObject.cpp
+++ b/lldb/source/ValueObject/ValueObject.cpp
@@ -2907,15 +2907,6 @@ ValueObjectSP ValueObject::AddressOf(Status &error) {
AddressType address_type = eAddressTypeInvalid;
const bool scalar_is_load_address = false;
-
- // For reference type we need to get the address of the object that
- // it refers to.
- if (GetCompilerType().IsReferenceType()) {
- ValueObjectSP deref_obj = Dereference(error);
- if (error.Fail() || !deref_obj)
- return ValueObjectSP();
- return deref_obj->AddressOf(error);
- }
addr_t addr = GetAddressOf(scalar_is_load_address, &address_type);
error.Clear();
if (addr != LLDB_INVALID_ADDRESS && address_type != eAddressTypeHost) {
diff --git a/lldb/test/API/lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py b/lldb/test/API/lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py
index 1374d4e1ec67ab..938fb1a6edf32c 100644
--- a/lldb/test/API/lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py
+++ b/lldb/test/API/lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py
@@ -25,24 +25,3 @@ def test(self):
# Typedef to a reference should dereference to the underlying type.
td_val = self.expect_var_path("td_to_ref_type", type="td_int_ref")
self.assertEqual(td_val.Dereference().GetType().GetName(), "int")
-
- def test_take_address_of_reference(self):
- """Tests taking address of lvalue/rvalue references in lldb works correctly."""
- self.build()
- lldbutil.run_to_source_breakpoint(
- self, "// break here", lldb.SBFileSpec("main.cpp")
- )
-
- plref_val_from_code = self.expect_var_path("pl_ref", type="TTT *")
- plref_val_from_expr_path = self.expect_var_path("&l_ref", type="TTT *")
- self.assertEqual(
- plref_val_from_code.GetValueAsAddress(),
- plref_val_from_expr_path.GetValueAsAddress(),
- )
-
- prref_val_from_code = self.expect_var_path("pr_ref", type="TTT *")
- prref_val_from_expr_path = self.expect_var_path("&r_ref", type="TTT *")
- self.assertEqual(
- prref_val_from_code.GetValueAsAddress(),
- prref_val_from_expr_path.GetValueAsAddress(),
- )
diff --git a/lldb/test/API/lang/cpp/dereferencing_references/main.cpp b/lldb/test/API/lang/cpp/dereferencing_references/main.cpp
index 4ddffd167ddeed..b64978a9029f81 100644
--- a/lldb/test/API/lang/cpp/dereferencing_references/main.cpp
+++ b/lldb/test/API/lang/cpp/dereferencing_references/main.cpp
@@ -9,7 +9,5 @@ int main() {
// typedef of a reference
td_int_ref td_to_ref_type = i;
- TTT *pl_ref = &l_ref;
- TTT *pr_ref = &r_ref;
return l_ref; // break here
}
|
jeffreytan81
approved these changes
Nov 5, 2024
PhilippRados
pushed a commit
to PhilippRados/llvm-project
that referenced
this pull request
Nov 6, 2024
This reverts commit 25909b8 due to unresolved questions about the behavior of "frame var" and ValueObject in the presence of references (see the original patch for discussion).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 25909b8 due to unresolved questions about the behavior of "frame var" and ValueObject in the presence of references (see the original patch for discussion).