Skip to content

Commit

Permalink
[lldb][NFC] Pass Stream& to ToXML methods in RegisterFlags
Browse files Browse the repository at this point in the history
As suggested in a review of some new code for this file, Stream
is more general. The code does not need to know that it's backed
by a string.
  • Loading branch information
DavidSpickett committed May 29, 2024
1 parent 0981dca commit 799316f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lldb/include/lldb/Target/RegisterFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace lldb_private {

class StreamString;
class Stream;
class Log;

class RegisterFlags {
Expand Down Expand Up @@ -56,7 +56,7 @@ class RegisterFlags {
/// Output XML that describes this field, to be inserted into a target XML
/// file. Reserved characters in field names like "<" are replaced with
/// their XML safe equivalents like "&gt;".
void ToXML(StreamString &strm) const;
void ToXML(Stream &strm) const;

bool operator<(const Field &rhs) const {
return GetStart() < rhs.GetStart();
Expand Down Expand Up @@ -119,7 +119,7 @@ class RegisterFlags {
std::string AsTable(uint32_t max_width) const;

// Output XML that describes this set of flags.
void ToXML(StreamString &strm) const;
void ToXML(Stream &strm) const;

private:
const std::string m_id;
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Target/RegisterFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ std::string RegisterFlags::AsTable(uint32_t max_width) const {
return table;
}

void RegisterFlags::ToXML(StreamString &strm) const {
void RegisterFlags::ToXML(Stream &strm) const {
// Example XML:
// <flags id="cpsr_flags" size="4">
// <field name="incorrect" start="0" end="0"/>
Expand All @@ -213,7 +213,7 @@ void RegisterFlags::ToXML(StreamString &strm) const {
strm.Indent("</flags>\n");
}

void RegisterFlags::Field::ToXML(StreamString &strm) const {
void RegisterFlags::Field::ToXML(Stream &strm) const {
// Example XML:
// <field name="correct" start="0" end="0"/>
strm.Indent();
Expand Down

0 comments on commit 799316f

Please sign in to comment.