[all-commits] [llvm/llvm-project] 1fed9a: [TableGen] Add bang-operators !getop and !setop.

Simon Tatham via All-commits all-commits at lists.llvm.org
Wed Dec 11 04:05:30 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fed9a0c0c3e74c21dfbd1edf18411a33b742f52
      https://github.com/llvm/llvm-project/commit/1fed9a0c0c3e74c21dfbd1edf18411a33b742f52
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2019-12-11 (Wed, 11 Dec 2019)

  Changed paths:
    M llvm/docs/TableGen/LangIntro.rst
    M llvm/docs/TableGen/LangRef.rst
    M llvm/include/llvm/TableGen/Record.h
    M llvm/lib/TableGen/Record.cpp
    M llvm/lib/TableGen/TGLexer.cpp
    M llvm/lib/TableGen/TGLexer.h
    M llvm/lib/TableGen/TGParser.cpp
    A llvm/test/TableGen/getsetop.td

  Log Message:
  -----------
  [TableGen] Add bang-operators !getop and !setop.

Summary:
These allow you to get and set the operator of a dag node, without
affecting its list of arguments.

`!getop` is slightly fiddly because in many contexts you need its
return value to have a static type more specific than 'any record'. It
works to say `!cast<BaseClass>(!getop(...))`, but it's cumbersome, so
I made `!getop` take an optional type suffix itself, so that can be
written as the shorter `!getop<BaseClass>(...)`.

Reviewers: hfinkel, nhaehnle

Reviewed By: nhaehnle

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list