This is an archive of the discontinued LLVM Phabricator instance.

[LTO][Legacy] Add API for passing LLVM options separately
ClosedPublic

Authored by thegameg on Nov 19 2019, 2:13 PM.

Details

Summary

In order to correctly pass options to LLVM, including options containing spaces which are used as delimiters for multiple options in lto_codegen_debug_options, add a new API: lto_codegen_debug_options_array.

Unfortunately, tools/lto has no testing infrastructure yet, so there are no tests associated with this patch.

Diff Detail

Event Timeline

thegameg created this revision.Nov 19 2019, 2:13 PM
ormris added a subscriber: ormris.Nov 19 2019, 2:29 PM

LGTM with one nitpick.

llvm/lib/LTO/LTOCodeGenerator.cpp
630

Maybe it would be cleaner if remove the old setCodeGenDebugOptions implementation and make the old C API to build an array and call the new interface?

thegameg updated this revision to Diff 230166.Nov 19 2019, 4:05 PM
thegameg marked an inline comment as done.
  • Move string splitting to lto_codegen_debug_options.
  • Remove null checks since none of the other lto_* functions do it.
steven_wu accepted this revision.Nov 19 2019, 4:13 PM
This revision is now accepted and ready to land.Nov 19 2019, 4:13 PM
This revision was automatically updated to reflect the committed changes.