[all-commits] [llvm/llvm-project] 655599: [CommandLine] Add callbacks to Options

Don Hinton via All-commits all-commits at lists.llvm.org
Fri Dec 6 15:25:24 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6555995a6d4545ff59dcf3388f9acfce3b6129a5
      https://github.com/llvm/llvm-project/commit/6555995a6d4545ff59dcf3388f9acfce3b6129a5
  Author: Don Hinton <donh at apple.com>
  Date:   2019-12-06 (Fri, 06 Dec 2019)

  Changed paths:
    M llvm/docs/CommandLine.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/Support/CommandLine.h
    M llvm/unittests/Support/CommandLineTest.cpp

  Log Message:
  -----------
  [CommandLine] Add callbacks to Options

Summary:
Add a new cl::callback attribute to Option.

This attribute specifies a callback function that is called when
an option is seen, and can be used to set other options, as in
option A implies option B.  If the option is a `cl::list`, and
`cl::CommaSeparated` is also specified, the callback will fire
once for each value.  This could be used to validate combinations
or selectively set other options.

Reviewers: beanz, thomasfinch, MaskRay, thopre, serge-sans-paille

Reviewed By: beanz

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70620




More information about the All-commits mailing list