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
- rL LLVM
- Build Status
Buildable 35569 Build 35568: 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 | ||
---|---|---|
1341 ↗ | (On Diff #331257) | 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 | ||
---|---|---|
1341 ↗ | (On Diff #331257) | Good call, I will send such a simplification. |