[llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)
Javier Lopez-Gomez via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 3 08:01:22 PDT 2025
================
@@ -119,6 +119,19 @@ template <typename T> class LVProperties {
#define KIND_3(ENUM, FIELD, F1, F2, F3) \
BOOL_BIT_3(Kinds, ENUM, FIELD, F1, F2, F3)
+const int DEC_WIDTH = 8;
+inline FormattedNumber decValue(uint64_t N, unsigned Width = DEC_WIDTH) {
+ return format_decimal(N, Width);
+}
+
+// Output the decimal representation of 'Value'.
+inline std::string decString(uint64_t Value, size_t Width = DEC_WIDTH) {
+ std::string String;
+ raw_string_ostream Stream(String);
+ Stream << decValue(Value, Width);
+ return Stream.str();
----------------
jalopezg-git wrote:
I suspect the suggestion below will use NRVO (while `Stream.str()` will not).
```suggestion
return String;
```
https://github.com/llvm/llvm-project/pull/135440
More information about the llvm-commits
mailing list