[Lldb-commits] [lldb] [lldb] Move RegisterFlags from Target to Utility (PR #206861)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 30 16:52:34 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Alex Langford (bulbazord)
<details>
<summary>Changes</summary>
I'm doing this so that I can move RegisterInfo from `lldb-private-types.h` to lldbUtility. It currently has a `RegisterFlags *` field, so having it sit in lldb-private-types.h masks the actual layering of our data types.
I considered moving RegisterInfo into Target, but RegisterValue (in lldbUtility) uses RegisterInfo directly. Because RegisterFlags has no internal dependencies, it seemed better to sink that instead.
---
Full diff: https://github.com/llvm/llvm-project/pull/206861.diff
12 Files Affected:
- (modified) lldb/include/lldb/Target/DynamicRegisterInfo.h (+1-1)
- (renamed) lldb/include/lldb/Utility/RegisterFlags.h (+3-3)
- (modified) lldb/source/Core/DumpRegisterInfo.cpp (+1-1)
- (modified) lldb/source/Core/DumpRegisterValue.cpp (+1-1)
- (modified) lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h (+1-1)
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+1-1)
- (modified) lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp (+1-1)
- (modified) lldb/source/Target/CMakeLists.txt (-1)
- (modified) lldb/source/Utility/CMakeLists.txt (+1)
- (renamed) lldb/source/Utility/RegisterFlags.cpp (+2-2)
- (modified) lldb/unittests/Core/DumpRegisterInfoTest.cpp (+1-1)
- (modified) lldb/unittests/Target/RegisterFlagsTest.cpp (+2-2)
``````````diff
diff --git a/lldb/include/lldb/Target/DynamicRegisterInfo.h b/lldb/include/lldb/Target/DynamicRegisterInfo.h
index 558adefe2e151..ab476bffde45a 100644
--- a/lldb/include/lldb/Target/DynamicRegisterInfo.h
+++ b/lldb/include/lldb/Target/DynamicRegisterInfo.h
@@ -12,8 +12,8 @@
#include <map>
#include <vector>
-#include "lldb/Target/RegisterFlags.h"
#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/StructuredData.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/include/lldb/Target/RegisterFlags.h b/lldb/include/lldb/Utility/RegisterFlags.h
similarity index 98%
rename from lldb/include/lldb/Target/RegisterFlags.h
rename to lldb/include/lldb/Utility/RegisterFlags.h
index 1250fd0330958..1fa9794e80365 100644
--- a/lldb/include/lldb/Target/RegisterFlags.h
+++ b/lldb/include/lldb/Utility/RegisterFlags.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_TARGET_REGISTERFLAGS_H
-#define LLDB_TARGET_REGISTERFLAGS_H
+#ifndef LLDB_UTILITY_REGISTERFLAGS_H
+#define LLDB_UTILITY_REGISTERFLAGS_H
#include <stdint.h>
#include <string>
@@ -195,4 +195,4 @@ class RegisterFlags {
} // namespace lldb_private
-#endif // LLDB_TARGET_REGISTERFLAGS_H
+#endif // LLDB_UTILITY_REGISTERFLAGS_H
diff --git a/lldb/source/Core/DumpRegisterInfo.cpp b/lldb/source/Core/DumpRegisterInfo.cpp
index eccc6784cd497..23946cf5428ba 100644
--- a/lldb/source/Core/DumpRegisterInfo.cpp
+++ b/lldb/source/Core/DumpRegisterInfo.cpp
@@ -8,7 +8,7 @@
#include "lldb/Core/DumpRegisterInfo.h"
#include "lldb/Target/RegisterContext.h"
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
diff --git a/lldb/source/Core/DumpRegisterValue.cpp b/lldb/source/Core/DumpRegisterValue.cpp
index aff4d2c621d7e..0a834bcd89960 100644
--- a/lldb/source/Core/DumpRegisterValue.cpp
+++ b/lldb/source/Core/DumpRegisterValue.cpp
@@ -9,9 +9,9 @@
#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/DataFormatters/DumpValueObjectOptions.h"
-#include "lldb/Target/RegisterFlags.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/ValueObject/ValueObject.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h b/lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h
index 496c395de48a4..ff69c94e0a7af 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERFLAGSDETECTOR_ARM64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERFLAGSDETECTOR_ARM64_H
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "llvm/ADT/StringRef.h"
#include <functional>
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 257eed8c78f93..aeafeb057819f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -65,7 +65,6 @@
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/ProcessIOHandler.h"
-#include "lldb/Target/RegisterFlags.h"
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/TargetList.h"
@@ -75,6 +74,7 @@
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/FileSpecList.h"
#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
diff --git a/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp b/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
index 80d5289178ed0..5e08254d07a45 100644
--- a/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+++ b/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
@@ -11,7 +11,7 @@
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "RegisterTypeBuilderClang.h"
#include "lldb/Core/PluginManager.h"
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/lldb-enumerations.h"
using namespace lldb_private;
diff --git a/lldb/source/Target/CMakeLists.txt b/lldb/source/Target/CMakeLists.txt
index 8e603f9a4df82..90fe6fc3ad973 100644
--- a/lldb/source/Target/CMakeLists.txt
+++ b/lldb/source/Target/CMakeLists.txt
@@ -40,7 +40,6 @@ add_lldb_library(lldbTarget
QueueList.cpp
RegisterContext.cpp
RegisterContextUnwind.cpp
- RegisterFlags.cpp
RegisterNumber.cpp
RemoteAwarePlatform.cpp
ScriptedThreadPlan.cpp
diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt
index e6d918c1ce9c7..c0d0a42367b26 100644
--- a/lldb/source/Utility/CMakeLists.txt
+++ b/lldb/source/Utility/CMakeLists.txt
@@ -53,6 +53,7 @@ add_lldb_library(lldbUtility NO_INTERNAL_DEPENDENCIES
Policy.cpp
ProcessInfo.cpp
RealpathPrefixes.cpp
+ RegisterFlags.cpp
RegisterValue.cpp
RegularExpression.cpp
Instrumentation.cpp
diff --git a/lldb/source/Target/RegisterFlags.cpp b/lldb/source/Utility/RegisterFlags.cpp
similarity index 99%
rename from lldb/source/Target/RegisterFlags.cpp
rename to lldb/source/Utility/RegisterFlags.cpp
index 976e03870ad9e..b465d2251a6f1 100644
--- a/lldb/source/Target/RegisterFlags.cpp
+++ b/lldb/source/Utility/RegisterFlags.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
@@ -426,4 +426,4 @@ FieldEnum::FieldEnum(std::string id, const Enumerators &enumerators)
UNUSED_IF_ASSERT_DISABLED(enumerator);
assert(enumerator.m_name.size() && "Enumerator name cannot be empty");
}
-}
\ No newline at end of file
+}
diff --git a/lldb/unittests/Core/DumpRegisterInfoTest.cpp b/lldb/unittests/Core/DumpRegisterInfoTest.cpp
index 593170c2822ab..df5518ec6b092 100644
--- a/lldb/unittests/Core/DumpRegisterInfoTest.cpp
+++ b/lldb/unittests/Core/DumpRegisterInfoTest.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/Core/DumpRegisterInfo.h"
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/StreamString.h"
#include "gtest/gtest.h"
diff --git a/lldb/unittests/Target/RegisterFlagsTest.cpp b/lldb/unittests/Target/RegisterFlagsTest.cpp
index ecffdd0fe44e6..ad86cab478843 100644
--- a/lldb/unittests/Target/RegisterFlagsTest.cpp
+++ b/lldb/unittests/Target/RegisterFlagsTest.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/RegisterFlags.h"
+#include "lldb/Utility/RegisterFlags.h"
#include "lldb/Utility/StreamString.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@@ -480,4 +480,4 @@ TEST(RegisterFlagsTest, EnumsToXML) {
"<enum id=\"enum_b\" size=\"4\">\n"
" <evalue name=\"one\" value=\"1\"/>\n"
"</enum>\n");
-}
\ No newline at end of file
+}
``````````
</details>
https://github.com/llvm/llvm-project/pull/206861
More information about the lldb-commits
mailing list