LLVMGetInitializer returns nullptr in case there is no
initializer. There is not much that can be done with nullptr in OCaml,
not even test if it is null. Also, there does not seem to be a C or
OCaml API to test if there is an initializer. So this diff changes
Llvm.global_initializer to return an option.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 38821 Build 38820: arc lint + arc unit
Event Timeline
Comment Actions
This change broke tests: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485. I reverted it in r373311.
Committers: please always run ninja check-all before committing.
Comment Actions
Apologies my bad, forgot to run the tests for this one...
I fixed the LLVM (ocaml) tests. I don't believe the clang failure was my fault and check-all passes in my setup.
llvm/bindings/ocaml/llvm/llvm_ocaml.c | ||
---|---|---|
1268 | ptr_to_option was recently introduced and is defined in this same file above. So you could just do something like this: https://github.com/llvm/llvm-project/blob/main/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c#L839 |
llvm/bindings/ocaml/llvm/llvm_ocaml.c | ||
---|---|---|
1268 | Good call, I will send such a simplification. |
ptr_to_option was recently introduced and is defined in this same file above. So you could just do something like this: https://github.com/llvm/llvm-project/blob/main/llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c#L839