[PATCH] D139924: LTO C API: always parse modules in opaque pointer mode.

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 10:15:40 PST 2022


lenary added inline comments.


================
Comment at: llvm/tools/lto/lto.cpp:138
+  void init() {
+    OwnedContext->setOpaquePointers(true);
+    setDiagnosticHandler(handleLibLTODiagnostic, nullptr);
----------------
dmgreen wrote:
> Hi - We noticed from out downstream embedded linker that this can be null if it comes in via lto_codegen_create, as opposed to lto_codegen_create_in_local_context.
We got downstream failures from this patch, because OwnedContext can be null here (if you use the first constructor on line 127, above).

I think maybe my suggestion is less falliable, but alters global state, so I'm not sure it's right either. It should at least work when OwnedContext is null, because the LTOCodeGenerator will still have a context to return (the global one)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139924/new/

https://reviews.llvm.org/D139924



More information about the llvm-commits mailing list