8000 LazyEncodedString everywhere by smaillet · Pull Request #247 · UbiquityDotNET/Llvm.NET · GitHub
[go: up one dir, main page]

Skip to content

LazyEncodedString everywhere #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

smaillet
Copy link
Member

Support use of LazyEncodedString everywhere to enhance performance overhead with pre-encoded strings etc.
Consumers of this library (and samples) should use the u8 suffix on all string literals to allow the compiler to perform encoding of the strings at compile time to reduce the overhead of conversion at runtime.

smaillet added 9 commits May 10, 2025 17:11
* Not complete!
* This compiles the interop and wrapper libraries only, no impacted libs are updated yet.
* Includes additional testing
* Apparently the JIT is assuming a 32 bit relocation as the default.
    - See llvm/llvm-project#65641
* This adds support for JIT builder and, in particular, TargetMachineBuilder so that the CodeModel is explicit in children
* Static usings are now explicit everywhere they are needed.
    - This removes static usings from the global usings.
* Converted name of static class for LLVM-C interop `Error` for consistency
* Added marshaling form of `LLVMCreateStringError()`
* Added `LLVMErrorRef.CreateForNativeOut()`
    - Eliminates need for annoying IDisposable warning suppression in many cases.
    - This support out/return of native handle for reverse P/Invoke scenarios.
* Added setting the triple to the module transform for Kaleidoscope
    - Ensures the triple is set and matches the JIT.
* Added `MarshalGCHandle.TryGet<>()` to support more intuitive acquisition of a managed context in native callbacks.
* Moved static factory for `ErrorInfo` to a constructor.
   - Static factory was used for out/return to native but that causes a lot of suppression of warnings for dispose so isn't used. Instead, most APIs will use the static methods on LLVMErrorRef to report any errors. If the callback includes calling through a delegate, then it might use the constructor to build the resulting `ErrorInfo` to pass to native code.
* Since native API surface changed to support this build the version bump is needed
* Added LibLLVMAttributeAllowedOn_All to make testing easier
* Changed signature of LibLLVMGetAttributeInfo to use an out param as the result instead of a raw pointer
    - Wrapper layout is identical to the interop form so a simple cast through a pointer is all that is needed to "project"
* Doc comment updates/fixes
* Test file was removed locally and missed
    - commit only included staged files so this edit and replace got in the way.
@smaillet smaillet merged commit e7d50f7 into UbiquityDotNET:develop May 16, 2025
2 checks passed
@smaillet smaillet deleted the LazyEncodedString_EveryWhere branch May 16, 2025 21:16
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
0