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

Projects
None yet
2 participants
@tannergooding
Copy link
Member

commented Apr 30, 2019

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());

This comment has been minimized.

Copy link
@tannergooding

tannergooding Apr 30, 2019

Author Member

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);

This comment has been minimized.

Copy link
@tannergooding

tannergooding Apr 30, 2019

Author Member

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);

This comment has been minimized.

Copy link
@tannergooding

tannergooding Apr 30, 2019

Author Member

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

This comment has been minimized.

Copy link
@tannergooding

tannergooding Apr 30, 2019

Author Member

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...

This comment has been minimized.

Copy link
@tannergooding

tannergooding Apr 30, 2019

Author Member

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...

This comment has been minimized.

Copy link
@mjsabby

mjsabby Apr 30, 2019

Member

I like the idea of an rsp.

@tannergooding tannergooding merged commit 95d79c5 into microsoft:master Apr 30, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.