[PATCH] D76903: Add a flag on the context to protect against creation of operations in unregistered dialects

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 17:08:32 PDT 2020


rriddle added a comment.

In D76903#1948944 <https://reviews.llvm.org/D76903#1948944>, @mehdi_amini wrote:

> In D76903#1948937 <https://reviews.llvm.org/D76903#1948937>, @rriddle wrote:
>
> > This is wrong. Operations are always part of a dialect. "foo" would be considered to be part of the builtin dialect, which currently has no namespace.
>
>
> Do you know why I see this?


Because OperationName::getDialect does not account for the fact that a prefix may be missing. It(IMO rightfully) assumes that all operations have a dialect namespace prefix. I wrote it that way because I'd always intended to make the builtin dialect have a proper namespace, but forgot about it until now. No one checks for the dialect prefix of the builtin operations ('func'/'module'/etc.) so it has just "worked" up until now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76903/new/

https://reviews.llvm.org/D76903





More information about the llvm-commits mailing list