@@ -153,7 +153,6 @@ const LinkerCLOptions &createLinkerConfigFromCLOptions() {
153153// / This class encapsulates all the file handling logic for linker.
154154class FileProcessor {
155155public:
156- using FileConfig = Linker::LinkFileConfig;
157156 using OwningMemoryBuffer = std::unique_ptr<MemoryBuffer>;
158157
159158 explicit FileProcessor (Linker &linker, raw_ostream &os, StringRef inMarker,
@@ -162,49 +161,39 @@ class FileProcessor {
162161
163162 // / Process and link multiple input files
164163 LogicalResult linkFiles (const std::vector<std::string> fileNames) {
165-
166- unsigned flags = linker.getFlags ();
167- FileConfig config = linker.firstFileConfig (flags);
168-
169164 for (StringRef fileName : fileNames) {
170- if (failed (processFile (fileName, config )))
165+ if (failed (processFile (fileName)))
171166 return failure ();
172-
173- // Update config for subsequent files
174- config = linker.linkFileConfig (flags);
175167 }
176168
177169 return success ();
178170 }
179171
180172private:
181- // / Process a single file
182- LogicalResult processFile (StringRef fileName, FileConfig config) {
183- // Open input file
173+ LogicalResult processFile (StringRef fileName) {
184174 std::string errorMessage;
185175 auto input = openInputFile (fileName, &errorMessage);
186176 if (!input)
187177 return linker.emitFileError (fileName, errorMessage);
188178
189179 // Process each file chunk
190- if (failed (processFile (std::move (input), config )))
180+ if (failed (processFile (std::move (input))))
191181 return linker.emitFileError (fileName, " Failed to process input file" );
192182
193183 return success ();
194184 }
195185
196- // / Process a single file buffer
197- LogicalResult processFile (OwningMemoryBuffer file, FileConfig config ) {
186+ // / Process a single input file, potentially containing multiple modules
187+ LogicalResult processFile (OwningMemoryBuffer file) {
198188 return splitAndProcessBuffer (
199189 std::move (file),
200- [config, this ](OwningMemoryBuffer chunk, raw_ostream & /* os */ ) {
201- return processFileChunk (std::move (chunk), config );
190+ [this ](OwningMemoryBuffer chunk, raw_ostream & /* os */ ) {
191+ return processFileChunk (std::move (chunk));
202192 },
203193 os, inMarker, outMarker);
204194 }
205195
206- // / Process a single input file, potentially containing multiple modules
207- LogicalResult processFileChunk (OwningMemoryBuffer buffer, FileConfig config) {
196+ LogicalResult processFileChunk (OwningMemoryBuffer buffer) {
208197 auto sourceMgr = std::make_shared<SourceMgr>();
209198 sourceMgr->AddNewSourceBuffer (std::move (buffer), SMLoc ());
210199
@@ -214,7 +203,7 @@ class FileProcessor {
214203
215204 // Parse the source file
216205 OwningOpRef<Operation *> op =
217- parseSourceFileForTool (sourceMgr, ctx, true /* insertImplicitModule*/ );
206+ parseSourceFileForTool (sourceMgr, ctx, /* insertImplicitModule= */ true );
218207 ctx->enableMultithreading (wasThreadingEnabled);
219208
220209 if (!op)
@@ -228,7 +217,7 @@ class FileProcessor {
228217 // TBD: internalization
229218 OwningOpRef<ModuleOp> mod = cast<ModuleOp>(op.release ());
230219 // Link the parsed operation
231- return linker.linkInModule (std::move (mod), config. flags );
220+ return linker.linkInModule (std::move (mod));
232221 }
233222
234223 Linker &linker;
0 commit comments