@@ -59,9 +59,10 @@ class Linker {
59
59
Linker (MLIRContext *context, const LinkerOptions &options = {})
60
60
: context(context), options(options) {}
61
61
62
- // / Add a module to be linked
63
62
LogicalResult addModule (OwningOpRef<ModuleOp> src);
64
63
64
+ LogicalResult addModule (OwningOpRef<ModuleOp> src, bool onlyNeeded);
65
+
65
66
// / Perform linking and materialization in the destination module.
66
67
// / Returns the linked module.
67
68
OwningOpRef<ModuleOp> link (bool sortSymbols = false );
@@ -71,16 +72,19 @@ class Linker {
71
72
LogicalResult emitFileError (const Twine &fileName, const Twine &message);
72
73
LogicalResult emitError (const Twine &message);
73
74
75
+ // / Return the flags controlling the linker behavior for the current module
76
+ unsigned getFlags () const ;
77
+
74
78
private:
75
79
// / Setup the linker based on the first module
76
80
LogicalResult initializeLinker (ModuleOp src);
77
81
82
+ // / Add a module to be linked
83
+ LogicalResult addModule (OwningOpRef<ModuleOp> src, unsigned flags);
84
+
78
85
// / Obtain the linker interface for the given module
79
86
ModuleLinkerInterface *getModuleLinkerInterface (ModuleOp op);
80
87
81
- // / Return the flags controlling the linker behavior for the current module
82
- unsigned getFlags () const ;
83
-
84
88
// / Preprocess the given module before linking with the given flags
85
89
LogicalResult summarize (ModuleOp src, unsigned flags);
86
90
0 commit comments