Page MenuHomePhabricator

[NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.
ClosedPublic

Authored by timshen on Jun 28 2017, 4:57 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

timshen created this revision.Jun 28 2017, 4:57 PM
chandlerc added inline comments.Jun 28 2017, 5:56 PM
clang/include/clang/Driver/Options.td
971–973 ↗(On Diff #104550)

I don't think we want to expose this flag in the driver -- it should really be a CC1-only thing for debugging.

As such, I think I'd just make it an independent flag:

-fexperimental-new-pass-manager-debug-logging

Or some such. This also seems easier than having to define a new kind.

timshen added inline comments.Jun 28 2017, 6:25 PM
clang/include/clang/Driver/Options.td
971–973 ↗(On Diff #104550)

The two small disadvantages of your suggestion is that

  1. It's more verbose to type: clang -fexperimental-new-pass-manager -fexperimental-new-pass-manager-debug-logging
  2. it's the 3 states vs 4 states pattern: clang -fno-experimental-new-pass-manager -fexperimental-new-pass-manager-debug-logging doesn't make sense to me, and it's good to avoid that.

What do you think about these trade offs?

joerg added a subscriber: joerg.Jun 29 2017, 6:56 AM

As I said in the discussion about similar flags for GVN, I'm generally fine with. We should have a big fat warning in the Release Notes that all -fexperimental-* flags are exactly that -- temporary and not intended for long term consumption. I.e. "we can and will remove them whenever it creates the most havoc".

timshen updated this revision to Diff 104753.Jun 29 2017, 3:35 PM

Use a cc1 flag -fdebug-pass-manager instead.

timshen retitled this revision from [NewPM] Add a flag -fexperimental-new-pass-manager=on/off/debug for printing debug output. to [NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information..Jun 29 2017, 3:36 PM
timshen added a reviewer: tejohnson.

Also add @tejohnson as a reviewer, since the LTO test changed

timshen marked 2 inline comments as done.Jun 29 2017, 3:38 PM
timshen added inline comments.
clang/include/clang/Driver/Options.td
971–973 ↗(On Diff #104550)

As discussed offline, (2) isn't a practical issue, and (1) makes sense since -fexperimental-new-pass-manager will ultimately go away, but the debug flag remains.

chandlerc edited edge metadata.Jun 29 2017, 3:39 PM

This looks great to me with a CC1-layer flag. But check that others are happy as well, thanks!

tejohnson accepted this revision.Jun 29 2017, 3:57 PM

LGTM. Just one minor nit on the option help string below. Thanks

clang/include/clang/Driver/CC1Options.td
329 ↗(On Diff #104753)

s/the debug prints/debug printing/

This revision is now accepted and ready to land.Jun 29 2017, 3:57 PM
timshen updated this revision to Diff 104766.Jun 29 2017, 4:07 PM
timshen marked an inline comment as done.

s/the debug prints/debug printing/

This revision was automatically updated to reflect the committed changes.