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

wael yehia via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 15:56:32 PST 2022


w2yehia added inline comments.


================
Comment at: llvm/tools/lto/lto.cpp:138
+  void init() {
+    OwnedContext->setOpaquePointers(true);
+    setDiagnosticHandler(handleLibLTODiagnostic, nullptr);
----------------
lenary wrote:
> 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)
this is breaking the AIX linker too - for the same reasons as above.


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

https://reviews.llvm.org/D139924



More information about the llvm-commits mailing list