Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LLVM's targets need to be initialized before they can be used. The Crystal compiler does this in `Crystal::Codegen::Target#to_target_machine`, but for external code that uses the LLVM wrappers directly, there is no simple way to do this. This PR adds two convenience methods which are more or less equivalent to LLVM's `LLVMInitializeNativeTarget` and `LLVMInitializeAllTargets`, both static line functions in `llvm-c/Target.h`, except the latter only initializes targets already supported by Crystal itself (e.g. no RISC-V or PowerPC at the moment even if `llvm-config` indicates their availability).
- Loading branch information