This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Fix LLVM_USE_SPLIT_DWARF
ClosedPublic

Authored by hliao on Feb 27 2020, 9:46 PM.

Details

Summary
  • Add -gsplit-dwarf as an option instead of a definition.
  • Only add that option on compilers supporting dwarf splitting, such as clang and gcc.

Diff Detail

Event Timeline

hliao created this revision.Feb 27 2020, 9:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2020, 9:46 PM

Not a big deal, but in LLDB we are compiling a handful of Objective-C++ (.mm) files. Would these get included by $<COMPILE_LANGUAGE:CXX>?

hliao updated this revision to Diff 247319.Feb 28 2020, 10:57 AM

Apply to objc and objcxx.

hliao updated this revision to Diff 247321.Feb 28 2020, 11:08 AM

Think again. There's no need to tell the languages for adding that compile option.

One thing I ran into by accident recently was that -DLLVM_USE_SPLIT_DWARF=1 in a Release (no debug info) also turned non debug info. Is that still the case and if yes, should we conditionalize this on building with debug info?

(sorry, that's more a question, and outside of the scope of this patch)

hliao updated this revision to Diff 247343.Feb 28 2020, 12:21 PM

That makes sense to me. At least, in release build, we won't generate
unnecessary files.

aprantl accepted this revision.Feb 28 2020, 1:53 PM

Thanks!

This revision is now accepted and ready to land.Feb 28 2020, 1:53 PM
This revision was automatically updated to reflect the committed changes.