Skip to content

Commit ebfdbe8

Browse files
committed
Show strings in string arrays, makes it easier to follow
1 parent 6c20273 commit ebfdbe8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ void WriteArrayEntries (GeneratorWriteContext context, LlvmIrVariable variable,
851851
bool ignoreComments = stride > 1;
852852
string? prevItemComment = null;
853853
ulong counter = 0;
854+
bool writeStringInComment = !ignoreComments && (elementType == typeof(string) || elementType == typeof(StringHolder));
854855

855856
if (entries != null) {
856857
foreach (object entry in entries) {
@@ -874,7 +875,13 @@ void WriteArrayEntries (GeneratorWriteContext context, LlvmIrVariable variable,
874875
}
875876

876877
if (writeIndices && String.IsNullOrEmpty (prevItemComment)) {
877-
prevItemComment = $" {counter}";
878+
string stringComment = String.Empty;
879+
if (writeStringInComment) {
880+
var holder = StringHolder.AsHolder (entry);
881+
stringComment = $" ('{holder.Data}')";
882+
}
883+
884+
prevItemComment = $" {counter}{stringComment}";
878885
}
879886
}
880887

0 commit comments

Comments
 (0)