[all-commits] [llvm/llvm-project] d867be: Allow Dialects to be initialized via nullptr.

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Sep 10 12:15:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d867be5de389f18cf3c1a61c8b9cbf8bfda8fe28
      https://github.com/llvm/llvm-project/commit/d867be5de389f18cf3c1a61c8b9cbf8bfda8fe28
  Author: Federico Lebrón <flebron at google.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M mlir/lib/TableGen/Dialect.cpp

  Log Message:
  -----------
  Allow Dialects to be initialized via nullptr.

This allows Dialect to follow the MLIR style of nullable objects, and in fact is expected by `Dialect::operator bool() const` which already tests whether `def == nullptr`. This just wasn't a reachable situation, because the constructor was dereferencing the pointer unconditionally.

Reviewed By: rriddle

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




More information about the All-commits mailing list