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

Regenerating the LLVMSharp sources based on 8.0.0 release #96

Merged
merged 2 commits into from Apr 30, 2019

Conversation

tannergooding
Copy link
Member

As per the title, this regenerates LLVMSharp based on the 8.0.0 release. However, It does not do any of the work to expose a managed wrapper for the new APIs.

This was generated based off the Ubuntu 18.04 pre-built tarball and added includes several new header files.

@@ -105,7 +105,6 @@ private void Dispose(bool disposing)
public void AddTypeBasedAliasAnalysisPass() => LLVM.AddTypeBasedAliasAnalysisPass(this.Unwrap());
public void AddScopedNoAliasAAPass() => LLVM.AddScopedNoAliasAAPass(this.Unwrap());
public void AddBasicAliasAnalysisPass() => LLVM.AddBasicAliasAnalysisPass(this.Unwrap());
public void AddBBVectorizePass() => LLVM.AddBBVectorizePass(this.Unwrap());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API was removed with https://reviews.llvm.org/D47436

@@ -42,9 +42,6 @@ public static partial class LLVM
[DllImport(libraryPath, EntryPoint = "LLVMSetMetadata2", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMetadata2(LLVMValueRef @Inst, uint @KindID, LLVMMetadataRef @MD);

[DllImport(libraryPath, EntryPoint = "LLVMMetadataReplaceAllUsesWith", CallingConvention = CallingConvention.Cdecl)]
public static extern void MetadataReplaceAllUsesWith(LLVMMetadataRef @MD, LLVMMetadataRef @New);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are auto generated with the correct signature by default.

@@ -179,5 +164,8 @@ public static partial class LLVM

[DllImport(libraryPath, EntryPoint = "LLVMInitializeCore", CallingConvention = CallingConvention.Cdecl)]
public static extern void InitializeCore(LLVMPassRegistryRef R);

[DllImport(libraryPath, EntryPoint = "LLVMAddInstructionCombiningPass", CallingConvention = CallingConvention.Cdecl)]
public static extern void AddInstructionCombiningPass(LLVMPassManagerRef PM);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, like LLVMInitializeCore, is defined in two header files.

@@ -11,7 +11,7 @@ if [%2]==[] (
)

csc /out:ClangSharpPInvokeGenerator.exe ClangSharpPInvokeGenerator\*.cs
ClangSharpPInvokeGenerator.exe --m LLVM --p LLVM --namespace LLVMSharp --output Generated.tmp.cs --libraryPath %1 --include %2 --file %2/llvm-c/Analysis.h --file %2/llvm-c/BitReader.h --file %2/llvm-c/BitWriter.h --file %2/llvm-c/Core.h --file %2/llvm-c/Disassembler.h --file %2/llvm-c/ErrorHandling.h --file %2/llvm-c/ExecutionEngine.h --file %2/llvm-c/Initialization.h --file %2/llvm-c/IRReader.h --file %2/llvm-c/Linker.h --file %2/llvm-c/LinkTimeOptimizer.h --file %2/llvm-c/lto.h --file %2/llvm-c/Object.h --file %2/llvm-c/OrcBindings.h --file %2/llvm-c/Support.h --file %2/llvm-c/Target.h --file %2/llvm-c/TargetMachine.h --file %2/llvm-c/Types.h --file %2/llvm-c/Transforms/IPO.h --file %2/llvm-c/Transforms/PassManagerBuilder.h --file %2/llvm-c/Transforms/Scalar.h --file %2/llvm-c/Transforms/Vectorize.h --e LLVMDisasmInstruction --e LLVMGetBufferStart --e LLVMGetDiagInfoDescription --e "LLVMGetDefaultTargetTriple --e LLVMCopyStringRepOfTargetData --e LLVMGetTargetMachineTriple --e LLVMGetTargetMachineCPU --e LLVMGetTargetMachineFeatureString --e LLVMPrintTypeToString --e LLVMCreateMessage --e LLVMDisposeMessage --e LLVMPrintModuleToString --e LLVMPrintValueToString --e LLVMOrcDisposeMangledSymbol --e LLVMTargetMachineEmitToFile --e LLVMInitializeCore
ClangSharpPInvokeGenerator.exe --m LLVM --p LLVM --namespace LLVMSharp --output Generated.tmp.cs --libraryPath %1 --include %2 --file %2/llvm-c/Analysis.h --file %2/llvm-c/BitReader.h --file %2/llvm-c/BitWriter.h --file %2/llvm-c/Comdat.h --file %2/llvm-c/Core.h --file %2/llvm-c/DataTypes.h --file %2/llvm-c/DebugInfo.h --file %2/llvm-c/Disassembler.h --file %2/llvm-c/DisassemblerTypes.h --file %2/llvm-c/Error.h --file %2/llvm-c/ErrorHandling.h --file %2/llvm-c/ExecutionEngine.h --file %2/llvm-c/Initialization.h --file %2/llvm-c/IRReader.h --file %2/llvm-c/Linker.h --file %2/llvm-c/LinkTimeOptimizer.h --file %2/llvm-c/lto.h --file %2/llvm-c/Object.h --file %2/llvm-c/OptRemarks.h --file %2/llvm-c/OrcBindings.h --file %2/llvm-c/Support.h --file %2/llvm-c/Target.h --file %2/llvm-c/TargetMachine.h --file %2/llvm-c/Types.h --file %2/llvm-c/Transforms/AggressiveInstCombine.h --file %2/llvm-c/Transforms/Coroutines.h --file %2/llvm-c/Transforms/InstCombine.h --file %2/llvm-c/Transforms/IPO.h --file %2/llvm-c/Transforms/PassManagerBuilder.h --file %2/llvm-c/Transforms/Scalar.h --file %2/llvm-c/Transforms/Utils.h --file %2/llvm-c/Transforms/Vectorize.h --e LLVMDisasmInstruction --e LLVMGetBufferStart --e LLVMGetDiagInfoDescription --e LLVMGetDefaultTargetTriple --e LLVMCopyStringRepOfTargetData --e LLVMGetTargetMachineTriple --e LLVMGetTargetMachineCPU --e LLVMGetTargetMachineFeatureString --e LLVMPrintTypeToString --e LLVMCreateMessage --e LLVMDisposeMessage --e LLVMPrintModuleToString --e LLVMPrintValueToString --e LLVMOrcDisposeMangledSymbol --e LLVMTargetMachineEmitToFile --e LLVMInitializeCore --e LLVMAddInstructionCombiningPass
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this can be generated directly from ClangSharp, we should figure out what to do with the checked in copy of the P/Invoke binding generator...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that it might be worth supporting some kind of rsp file for argument inputs so projects don't hit the upper limit of command line input lengths...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of an rsp.

@tannergooding tannergooding merged commit 95d79c5 into dotnet:master Apr 30, 2019
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.

None yet

2 participants