This PR exposes the LLVMAddModuleFlag and LLVMLinkModules2 functionality within the LLVMModuleRef class. This allows for a more straightforward method for adding module flags using the LLVMSharp API and provides a way to link modules using the LLVMSharp API. It also adds a test to ensure that LLVMAddModuleFlag constructs the correct flag behavior in the outputted debug information.
The addition of the AddModuleFlag functionality also helps to clarify this situation:
There are two different ways to add a module flag in LLVM Native: A) using LLVMAddModuleFlag (which expects a 0-based LLVMModuleFlagBehavior) and B) using LLVMAddNamedMetadataOperand (which expects a 1-based behavior represented by a uint). Exposing the AddModuleFlag functionality is meant to ease this confusion by adding a more straightforward method to create module flags that uses the LLVMModuleFlagBehavior enum as expected.
This PR exposes the LLVMAddModuleFlag and LLVMLinkModules2 functionality within the LLVMModuleRef class. This allows for a more straightforward method for adding module flags using the LLVMSharp API and provides a way to link modules using the LLVMSharp API. It also adds a test to ensure that LLVMAddModuleFlag constructs the correct flag behavior in the outputted debug information.
The addition of the AddModuleFlag functionality also helps to clarify this situation: There are two different ways to add a module flag in LLVM Native: A) using LLVMAddModuleFlag (which expects a 0-based LLVMModuleFlagBehavior) and B) using LLVMAddNamedMetadataOperand (which expects a 1-based behavior represented by a uint). Exposing the AddModuleFlag functionality is meant to ease this confusion by adding a more straightforward method to create module flags that uses the LLVMModuleFlagBehavior enum as expected.