Skip to content

Conversation

@sedymrak
Copy link
Contributor

An existing code can be further simplified.

@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2025

@llvm/pr-subscribers-lldb

Author: Matej Košík (sedymrak)

Changes

An existing code can be further simplified.


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

1 Files Affected:

  • (modified) lldb/source/Utility/RegisterValue.cpp (+1-2)
diff --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp
index c28c9e2d4d106..f555529d314e5 100644
--- a/lldb/source/Utility/RegisterValue.cpp
+++ b/lldb/source/Utility/RegisterValue.cpp
@@ -197,8 +197,7 @@ Status RegisterValue::SetValueFromData(const RegisterInfo &reg_info,
     else {
       std::vector<uint8_t> native_endian_src(src_len, 0);
       src.ExtractBytes(src_offset, src_len,
-                       llvm::sys::IsLittleEndianHost ? eByteOrderLittle
-                                                     : eByteOrderBig,
+                       endian::InlHostByteOrder(),
                        native_endian_src.data());
       llvm::APInt uint = llvm::APInt::getZero(src_len * 8);
       llvm::LoadIntFromMemory(uint, native_endian_src.data(), src_len);

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@DavidSpickett
Copy link
Collaborator

Looks ok but please give this a (slightly) more descriptive title. "[lldb] Use InlHostByteOrder in RegisterValue::SetValueFromData" would be fine.

@sedymrak sedymrak changed the title [lldb] simplify the code [lldb] Use InlHostByteOrder in RegisterValue::SetValueFromData Nov 26, 2025
@JDevlieghere
Copy link
Member

LGTM. Please let us know if you need one of us to merge this on your behalf.

@sedymrak
Copy link
Contributor Author

LGTM. Please let us know if you need one of us to merge this on your behalf.

Yes, if everything is in order with this pull-request, please merge this on my behalf.
(I am not authorized to do that.)

Thank you!

@JDevlieghere JDevlieghere merged commit b7eb988 into llvm:main Nov 27, 2025
10 checks passed
tanji-dg pushed a commit to tanji-dg/llvm-project that referenced this pull request Nov 27, 2025
…169624)

An existing code can be further simplified.

---------

Co-authored-by: Matej Košík <matej.kosik@codasip.com>
GeneraluseAI pushed a commit to GeneraluseAI/llvm-project that referenced this pull request Nov 27, 2025
…169624)

An existing code can be further simplified.

---------

Co-authored-by: Matej Košík <matej.kosik@codasip.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants