Add check for initialized

This commit is contained in:
Benson Chu 2026-03-31 16:40:00 -05:00
parent 78b2de42bf
commit 3197b406af

View file

@ -140,9 +140,12 @@
(load-llvm-mode (lls/conf-get 'root-dir))
(message "llvm-lib initialize!"))
(defun lls/initialized? ()
(and (lls/get-llvm-config)
(llvm-config-p (lls/get-llvm-config))))
(defun lls/ensure-initialized ()
(when (or (not (lls/get-llvm-config))
(not (llvm-config-p (lls/get-llvm-config))))
(when (not (lls/initialized?))
(if (not (functionp lls/target-init-fun))
(error "Please register an init function for llvm")
(lls/initialize))))