@@ -59,9 +59,10 @@ class Linker {
5959 Linker (MLIRContext *context, const LinkerOptions &options = {})
6060 : context(context), options(options) {}
6161
62- // / Add a module to be linked
6362 LogicalResult addModule (OwningOpRef<ModuleOp> src);
6463
64+ LogicalResult addModule (OwningOpRef<ModuleOp> src, bool onlyNeeded);
65+
6566 // / Perform linking and materialization in the destination module.
6667 // / Returns the linked module.
6768 OwningOpRef<ModuleOp> link (bool sortSymbols = false );
@@ -71,16 +72,19 @@ class Linker {
7172 LogicalResult emitFileError (const Twine &fileName, const Twine &message);
7273 LogicalResult emitError (const Twine &message);
7374
75+ // / Return the flags controlling the linker behavior for the current module
76+ unsigned getFlags () const ;
77+
7478private:
7579 // / Setup the linker based on the first module
7680 LogicalResult initializeLinker (ModuleOp src);
7781
82+ // / Add a module to be linked
83+ LogicalResult addModule (OwningOpRef<ModuleOp> src, unsigned flags);
84+
7885 // / Obtain the linker interface for the given module
7986 ModuleLinkerInterface *getModuleLinkerInterface (ModuleOp op);
8087
81- // / Return the flags controlling the linker behavior for the current module
82- unsigned getFlags () const ;
83-
8488 // / Preprocess the given module before linking with the given flags
8589 LogicalResult summarize (ModuleOp src, unsigned flags);
8690
0 commit comments