[llvm] [SPIR-V] Expose an API call to initialize SPIRV target and translate input LLVM IR module to SPIR-V (PR #107216)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 06:54:42 PDT 2024


https://github.com/Keenuts commented:

I'm not super familiar with how 3rd party use LLVM, but AFAIK they do have access to the public LLVM headers no?
If that's correct, why not require a struct with the option we need in an already parsed format?

```
struct BuildOptions {
    CodeGenOptLevel OptLevel;
    Triple TargetTriple;
    std::vector<std::string> AllowedExtensions;
    ...
};
SPIRVTranslateModule(Module *M, const BuildOptions& Options, ...)
```
?

Duplicating the CLI feels a bit weird IMO

https://github.com/llvm/llvm-project/pull/107216


More information about the llvm-commits mailing list