Page MenuHomePhabricator

[OCaml] Handle nullptr in Llvm.global_initializer
AcceptedPublic

Authored by kren1 on Jul 24 2019, 2:17 AM.

Details

Summary

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.

Event Timeline

kren1 created this revision.Jul 24 2019, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2019, 2:17 AM
This revision is now accepted and ready to land.Jul 24 2019, 11:51 AM

Thanks @whitequark . @modocache could you commit this for me?

This revision was automatically updated to reflect the committed changes.

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.

kren1 reopened this revision.Oct 1 2019, 7:04 AM
This revision is now accepted and ready to land.Oct 1 2019, 7:04 AM
kren1 updated this revision to Diff 222615.Oct 1 2019, 7:45 AM

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.