Skip to content
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

Llvm 10 #169

Merged
merged 6 commits into from
Apr 9, 2020
Merged

Llvm 10 #169

merged 6 commits into from
Apr 9, 2020

Conversation

smaillet
Copy link
Member

@smaillet smaillet commented Apr 9, 2020

merging in work on LLVM10 to active development branch

## Initial pass at LLVM 10 support to get tests to pass

## Core Changes
Additional work is needed to fully support LLVM10 changes - this is just the minimum bar tp get the ball rolling.
* Added support for attributes with type parameter (IR-> managed only at this point, full support for new features later)
* Updated triple bindings to support new triple components in LLVM10

## Breaking Changes
* TargetObjectFile removed in favor of TargetBinary as it isn't really an ObjectFile only anymore. (Follows underlying changes in LLVM and the LLVM-C APIs)
* Removed  DebugInfoFlags values no longer present in underlying LLVM definitions
   - DebugInfoFlags.BlockByrefStruct
   - DebugInfoFlags.MainSubProgram
   - DebugInfoFlags.Trivial
* DiBuilder.CreateTypedef() now has an alignInBits parameter

## Other changes
* Added validation of input YAML with warnings for redundant or missing references
* Updated license info to LLVM's new lic.
* Fixed sample Kaleidoscope parser AST to corrrectly capture extern status of prototypes
* replaced extension LibLLVM* extension functions with new official LLVM* functions
* Added marking of deprecated functions in the interop API rather then deleting them outright, in case consumers are using it directly
* Added Kind property to AtomicRMW instructions
* Added IsWeak property to AtomicCmpXchg instructions
* Added support for the Freeze instruction
* Added additional Basic block insert/append methods
* Added support for creating macro files and macros to DebugInfoBuilder
* Removed C#8 features from bindings generator and forced project to framework defaults. This prevents hard to track compile/runtime fails if the language features require runtime support since the CppSHarp libs don't yet work on anything but net47
* Fixed handling of unsafe types in bindings generator
* Made conversion of pointer to IntPtr explicit so that functions returning pointers are easier to detect
* Updated type printer to not convert all pointer types to IntPtr so that conversion is explicit.
* added new !Unsafe (and corresponding class YamlUnsafeReturn) to the configuration to explicitly allow unsafe return types on functions requiring them. (This suppresses the validation error for the specified function)
* Updated config file with APIs requiring updates based on these changes
* Updated DIFile to use official LLVM functions to get property values
* Corrected nullability of scopes in Debug information
* Removed more redundant LibLLVM* functions and replaced with official LLVM* Functions
* Added more complete support for GlobalIFuncs, including module enumeration
* removed dead code from tutorial samples
* re-worked build scripts in prep for building llvm libs directly
* Moved to a common project/repo neutral module to leverage common functions across repos in general
* updated all the scripts to leverage new common module
* Increased strictness level to help catch bugs in the scripts earlier
* Updates for nullability and deprecated functions
* Nuget updates
* Added function pointer typedef (delegates) to the checks and marshaling support to ensure they are generated with a usable signature
* Ran solution wide cleanup to fix style of refactored code.
* Fixed common build to auto opt-in to module install on automated builds
* Removed force parameter from Find-VSInstance
Shifted to testing for EnvVar instead)
* Corrected multiple path names for hashtable indexing
* added llvm_10 branch to build YAML to allow validation of in progress work
- updated main program of Kaleidoscope samples to better use existing reactive pipeline support. (Cleans up construction of the pipeline)
- Updated return type of the Generate method to use a new Optional<T> to indicate if a value was generated or not, instead of using a null value (or assuming the default value of a value type was never valid)
* Replaced use of Observalbe with AsyncEnumerator as it is a more familiar flow and makes more sense for the REPL loops. This does add a bit more code to the sample program itself, but makes the error handling, parsing and generation more obvious.
* Added ErrorNode to the AST so that errors are recorded in tho the AST instead of thrown as an exception. (The AST and parsing no longer throw errors except for unexpected runtime states (Not user input/syntax errors))
* Simplified error handling and code generator return types to use OptionalValue<T> instead of null references etc. to indicate the operation completed but has no new data.
Added a unit test project (Currently empty) to flesh out unit testing of the samples to aid in validating their state and provide greater coverage of the core library itself.
* Major refactoring of Kaleidoscope parser and grammar libraries
   - The parser is now entirely in the grammar assembly and the ANTLR support is internal to that library. (e.g. the use of ANTLR is encapsulated in the assembly as an implementation detail)
* Re-factored Kaleidoscope and enabled testing of codegen
* Kaleidoscope runtime now includes a generalized REPL abstract base class that eliminates a lot of duplicated code for each sample.
* Shifted to a simpler synchronous IEnumerable as the Async adds complexity and potential problems with threading and LLVM thread unsafe Contexts
* Added tests to at least run the sample language files through to ensure code gen doesn't blow up. (The actual output isn't validated yet but validating it doesn't crash is a step forward).

* * Simplified library init
* Updated doc comments on limitation of one init per process (ever)
* Added safer dispose to OrcJit as finalizer is allowed to run on a type where the constructor never did In particular if the constructor is called but fails to complete due to an exception, the finalizer is still called!
@smaillet smaillet merged commit ea80bad into develop Apr 9, 2020
@smaillet smaillet deleted the llvm_10 branch April 9, 2020 02:57
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