[PATCH] D39596: Allow separation of declarations and definitions in <Target>ISelDAGToDAG.inc

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 07:05:33 PDT 2017


kparzysz created this revision.
Herald added a subscriber: igorb.

This patch adds the ability to include the member function declarations in the instruction selector class separately from the member bodies.

Defining GET_DAGISEL_DECL macro to any value will only include the member declarations. To include bodies, define GET_DAGISEL_BODY macro to be the selector class name. Example:

  class FooDAGToDAGISel : public SelectionDAGISel {
    // Pull in declarations only.
    #define GET_DAGISEL_DECL
    #include "FooISelDAGToDAG.inc"
  };
  
  // Include the function bodies (with names qualified with the provided
  // class name).
  #define GET_DAGISEL_BODY FooDAGToDAGISel
  #include "FooISelDAGToDAG.inc"

When neither of the two macros are defined, the function bodies are emitted inline (in the same way as before this patch).


Repository:
  rL LLVM

https://reviews.llvm.org/D39596

Files:
  utils/TableGen/DAGISelEmitter.cpp
  utils/TableGen/DAGISelMatcherEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39596.121471.patch
Type: text/x-patch
Size: 8683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171103/faa2fa4c/attachment.bin>


More information about the llvm-commits mailing list