This is an archive of the discontinued LLVM Phabricator instance.

[mlir][DeclareOpInterfaceMethods] Allow specifying a set of methods to force declaration generation for.
ClosedPublic

Authored by rriddle on Apr 28 2020, 11:31 AM.

Details

Summary

Currently a declaration won't be generated if the method has a default implementation. Meaning that operations that wan't to override the default have to explicitly declare the method in the extraClassDeclarations. This revision adds an optional list parameter to DeclareOpInterfaceMethods to allow for specifying a set of methods that should always have the declarations generated, even if there is a default.

Depends On D79029

Diff Detail

Event Timeline

rriddle created this revision.Apr 28 2020, 11:31 AM
jpienaar accepted this revision.Apr 28 2020, 1:47 PM

Thanks, so we have

  • no default -> generate declaration
  • default -> if ("op wants to specialize this") then generate declaration -> don't generate def

I was trying to think of what is the common case (wrt white list or black list approach), but probably if there is a default then it is the common case and so this should be least typing :)

This revision is now accepted and ready to land.Apr 28 2020, 1:47 PM
rriddle updated this revision to Diff 261051.Apr 29 2020, 2:56 PM

Add missing include

This revision was automatically updated to reflect the committed changes.