Skip to content

Commit de9c994

Browse files
committed
fixup! add format_provider for FunctionCallLabel
1 parent 6eb12d9 commit de9c994

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lldb/include/lldb/Expression/Expression.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <string>
1414
#include <vector>
1515

16+
#include "llvm/Support/FormatProviders.h"
1617

1718
#include "lldb/Expression/ExpressionTypeSystemHelper.h"
1819
#include "lldb/lldb-forward.h"
@@ -147,4 +148,11 @@ inline constexpr llvm::StringRef FunctionCallLabelPrefix = "$__lldb_func";
147148

148149
} // namespace lldb_private
149150

151+
namespace llvm {
152+
template <> struct format_provider<lldb_private::FunctionCallLabel> {
153+
static void format(const lldb_private::FunctionCallLabel &label,
154+
raw_ostream &OS, StringRef Style);
155+
};
156+
} // namespace llvm
157+
150158
#endif // LLDB_EXPRESSION_EXPRESSION_H

lldb/source/Expression/Expression.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include "lldb/Target/ExecutionContextScope.h"
1111
#include "lldb/Target/Target.h"
1212

13-
#include "llvm/ADT/StringRef.h"
1413
#include "llvm/ADT/SmallVector.h"
14+
#include "llvm/ADT/StringRef.h"
1515
#include "llvm/Support/Error.h"
1616

1717
using namespace lldb_private;
@@ -87,3 +87,10 @@ std::string lldb_private::FunctionCallLabel::toString() const {
8787
module_id, symbol_id, lookup_name)
8888
.str();
8989
}
90+
91+
void llvm::format_provider<FunctionCallLabel>::format(
92+
const FunctionCallLabel &label, raw_ostream &OS, StringRef Style) {
93+
OS << llvm::formatv("FunctionCallLabel{ module_id: {0:x}, symbol_id: {1:x}, "
94+
"lookup_name: {2} }",
95+
label.module_id, label.symbol_id, label.lookup_name);
96+
}

0 commit comments

Comments
 (0)