Skip to content

Commit 4af7bfc

Browse files
authored
Added use of global imports to all projects (#345)
- The MSBuild `ImplicitUsings` is banned but the C# language of `global using` is not. This updates projects to use the C# feature without the MSBuild problems. * Additional doc updates.
1 parent 9b2826a commit 4af7bfc

File tree

120 files changed

+398
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+398
-666
lines changed

src/Interop/LlvmBindingsGenerator/CmdLineArgs.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System.CommandLine.Parsing;
5-
using System.IO;
6-
7-
using CppSharp;
8-
94
namespace LlvmBindingsGenerator
105
{
116
internal partial class CmdLineArgs
127
{
138
// [Option("-l", Required=true, Description="Root of source with the LLVM headers to parse (Assumes and validates a sub-folder 'include')"]
149
// [AcceptExistingFolderOnly]
15-
// [Validator( "CmdLineArgs.ValidateIncludeFolder" )]
10+
// [Validator( nameof(ValidateIncludeFolder) )]
1611
public required DirectoryInfo LlvmRoot { get; init; }
1712

1813
// [Option("-e", Required=true, Description="Root of source with the LibLLVM extension headers to parse (Assumes and validates a sub-folder 'include')"]
1914
// [AcceptExistingFolderOnly]
20-
// [Validator( "CmdLineArgs.ValidateIncludeFolder" )]
15+
// [Validator( nameof(ValidateIncludeFolder) )]
2116
public required DirectoryInfo ExtensionsRoot { get; init; }
2217

2318
// [Option("-e", Required=true, Description="Output to place the generated code for handles. No handle source is generated if this is not provided")]

src/Interop/LlvmBindingsGenerator/CmdLineArgs.g.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using System;
1+
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
2+
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
3+
4+
using System;
25
using System.Collections.Generic;
36
using System.CommandLine;
47
using System.CommandLine.Parsing;
@@ -45,7 +48,7 @@ public static AppControlledDefaultsRootCommand BuildRootCommand( CmdLineSettings
4548
{
4649
// description is hard coded and should come from generation attribute on the "CmdLineArgs" type
4750
// TODO: Check for duplicate options.
48-
// (-?,-h, --help, and --version) are used by default options so nothing should use those values.
51+
// (-?, -h, --help, and --version) are used by default options so nothing should use those values.
4952
// Generator/analyzer should validate that so it isn't a runtime hit.
5053
return new AppControlledDefaultsRootCommand( settings, "LLVM handle wrapper source generator" )
5154
{

src/Interop/LlvmBindingsGenerator/Configuration/GeneratorConfig.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System.Collections.Immutable;
5-
64
namespace LlvmBindingsGenerator.Configuration
75
{
86
internal class GeneratorConfig

src/Interop/LlvmBindingsGenerator/Configuration/HandleDetails.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System.Diagnostics.CodeAnalysis;
5-
64
namespace LlvmBindingsGenerator.Configuration
75
{
86
/// <summary>Details for a handle</summary>

src/Interop/LlvmBindingsGenerator/Configuration/IGeneratorConfig.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System.Collections.Generic;
5-
using System.Collections.Immutable;
6-
using System.Linq;
7-
8-
using LlvmBindingsGenerator.CppSharpExtensions;
9-
using LlvmBindingsGenerator.Templates;
10-
114
namespace LlvmBindingsGenerator.Configuration
125
{
136
/// <summary>Interface for a generator configuration</summary>

src/Interop/LlvmBindingsGenerator/CppSharpExtensions/ASTContextExtensions.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.Diagnostics.CodeAnalysis;
7-
using System.Linq;
8-
9-
using CppSharp.AST;
10-
114
namespace LlvmBindingsGenerator
125
{
136
internal static class ASTContextExtensions

src/Interop/LlvmBindingsGenerator/CppSharpExtensions/Driver.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System;
5-
using System.Collections.Generic;
6-
using System.IO;
7-
using System.Linq;
8-
9-
using CppSharp;
10-
using CppSharp.AST;
11-
using CppSharp.Generators;
12-
using CppSharp.Parser;
13-
using CppSharp.Passes;
14-
using CppSharp.Types;
15-
using CppSharp.Utils;
16-
174
using ClangParser = CppSharp.ClangParser;
5+
using Module = CppSharp.AST.Module;
186

197
namespace LlvmBindingsGenerator
208
{

src/Interop/LlvmBindingsGenerator/CppSharpExtensions/ErrorTrackingDiagnostics.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using System;
5-
6-
using CppSharp;
7-
84
namespace LlvmBindingsGenerator
95
{
106
internal class ErrorTrackingDiagnostics

src/Interop/LlvmBindingsGenerator/CppSharpExtensions/FieldExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using CppSharp.AST;
5-
64
namespace LlvmBindingsGenerator
75
{
86
internal static class FieldExtensions

src/Interop/LlvmBindingsGenerator/CppSharpExtensions/ICodeGenerator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
22
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
33

4-
using LlvmBindingsGenerator.CppSharpExtensions;
5-
64
namespace LlvmBindingsGenerator
75
{
86
internal interface ICodeGenerator

0 commit comments

Comments
 (0)