Fix ThunkGenerator (#84390)
authorMichał Petryka <35800402+MichalPetryka@users.noreply.github.com>
Thu, 6 Apr 2023 05:14:14 +0000 (07:14 +0200)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 05:14:14 +0000 (22:14 -0700)
* Fix ThunkGenerator

Fixes:
```
 error CA1859: Change type of parameter 'tr' from 'System.IO.TextReader' to 'System.IO.StreamReader' for improved performance
 error CA1859: Change return type of method 'ParseInput' from 'System.Collections.Generic.IEnumerable<Thunkerator.FunctionDecl>' to 'System.Collections.ObjectModel.ReadOnlyCollection<Thunkerator.FunctionDecl>' for improved performance
```

* Fix typo

src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs

index 633e8a9..b28a018 100644 (file)
@@ -3,6 +3,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
@@ -174,7 +175,7 @@ namespace Thunkerator
             IFDEFING
         }
 
-        private static IEnumerable<FunctionDecl> ParseInput(TextReader tr)
+        private static ReadOnlyCollection<FunctionDecl> ParseInput(StreamReader tr)
         {
             Dictionary<string, TypeReplacement> ThunkReturnTypes = new Dictionary<string, TypeReplacement>();
             Dictionary<string, TypeReplacement> ThunkTypes = new Dictionary<string, TypeReplacement>();