Skip to content

Conversation

@smaillet
Copy link
Member

This adds suport for more pojects to support multi-targetting.
It is worth considering how to move these "support" libraries to
a distinct repo that is NOT connected to LLVM at all. They are now rich enough on their own to warrant a distinct repo.

Moved poly fills to a shared project.

  • Using a Roslyn Source generator has problems with dependencies.
  • Added Code analysis utilities
    • Targets .NET8 and .NET Standard 2.0
  • Doc comment updates/corrections
  • Removed exception from DisposableAction.Dispose
    • Dispose should not throw an exception.
  • Added support for resource string formatting simlification.
  • Replaced nint.Zero with IntPtr.Zero or 0
    • Originally, the methods exposed by nint were filtered to exclude Zero and then later converted to a pure alias. Sadly, the compiler language version does NOT control this behavior. It's System.Runtime.CompilerServices.RuntimeFeature.NumericIntPtr
  • Added multipe define checks based on the target framework to allow projects to multi-target
  • Fixed LazyEncoded string to remove need for System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray<T> method
    • Apparently the compiler doesn't take extensions into account and requires existence of the static method directly on the type. So no poly fill is possible.
  • Added exception to detect if native API returns an invalid (null or empty)
  • Fixed bug in fluent ThrowIfOutOfRange handling
  • Blocked out System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray<T>

Fixed handling of DIExpression

  • Since the LLVM-C API uses unwrap<DIExpression>(Expr) that will assert in a debug build that the Expr is NOT null. In a release build it sitll does the right thing and treats a null as if it was empty but in a debug build it will assert causing a dialog and potential app crash.
    • Most cases used a null coelescence operation to provide a non-null expression but DiBuilderAlias.CreateGlobalVariableExpression did not do that.

* Using a Roslyn Source generator has problems with dependencies.
* Added Code analysis utilities
    - Targets .NET8 and .NET Standard 2.0
* Doc comment updates/corrections
* Removed exception from `DisposableAction.Dispose`
    - `Dispose` should not throw an exception.
* Added support for resource string formatting simlification.
* Replaced `nint.Zero` with `IntPtr.Zero` or `0`
    - Originally, the methods exposed by nint were filtered to exclude `Zero` and then later converted to a pure alias. Sadly, the compiler language version does ***NOT*** control this behavior. It's ` System.Runtime.CompilerServices.RuntimeFeature.NumericIntPtr`
* Added multipe define checks based on the target framework to allow projects to multi-target
…rServices.RuntimeHelpers.GetSubArray<T>` method

    - Apparently the compiler doesn't take extensions into account and requires existence of the static method directly on the type. So no poly fill is possible.
* Added exception to detect if native API returns an invalid (null or empty)
* Fixed bug in fluent `ThrowIfOutOfRange` handling
* Blocked out `System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray<T>`
* Since the LLVM-C API uses `unwrap<DIExpression>(Expr)` that will `assert` in a debug build that the `Expr` is NOT null. In a release build it sitll does the right thing and treats a null as if it was empty but in a debug build it will assert causing a dialog and potential app crash.
    - Most cases used a null coelescence operation to provide a non-null expression but `DiBuilderAlias.CreateGlobalVariableExpression` did not do that.
@github-actions
Copy link

Test Results

 12 files   12 suites   46s ⏱️
375 tests 262 ✅ 113 💤 0 ❌
448 runs  335 ✅ 113 💤 0 ❌

Results for commit 36974e4.

@smaillet smaillet merged commit 25fafd7 into UbiquityDotNET:develop Nov 13, 2025
4 checks passed
@smaillet smaillet deleted the MultiTargettingSupportLibs branch November 13, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant