Lines Matching +defs:buffer +defs:file +defs:name
148 // FIXME: We could open the file in createFutureForFile and avoid needing to
149 // return an error here, but for the moment that would cost us a file descriptor
153 // Create a std::future that opens and maps a file using the best strategy for
157 // On Windows, file I/O is relatively slow so it is best to do this
179 for (ObjFile *file : ctx.objFileInstances) {
180 ArrayRef<Chunk *> v = file->getChunks();
203 void LinkerDriver::addFile(InputFile *file) {
204 Log(ctx) << "Reading " << toString(file);
205 if (file->lazy) {
206 if (auto *f = dyn_cast<BitcodeFile>(file))
209 cast<ObjFile>(file)->parseLazy();
211 file->parse();
212 if (auto *f = dyn_cast<ObjFile>(file)) {
214 } else if (auto *f = dyn_cast<BitcodeFile>(file)) {
216 Err(ctx) << "LTO object file " << toString(file)
221 } else if (auto *f = dyn_cast<ImportFile>(file)) {
226 MachineTypes mt = file->getMachineType();
232 Err(ctx) << toString(file)
238 Err(ctx) << toString(file) << ": machine type " << machineToStr(mt)
248 parseDirectives(file);
267 // File type is detected by contents, not by file extension.
274 std::unique_ptr<Archive> file =
276 Archive *archive = file.get();
277 make<std::unique_ptr<Archive>>(std::move(file)); // take ownership
298 << ": is not a native COFF file. Recompile without /GL";
307 << ": bad file type. Did you specify a DLL instead of an "
313 Err(ctx) << mbref.getBufferIdentifier() << ": unknown file type";
326 // Retry reading the file (synchronously) now that we may have added
332 // winsysroot file.
340 // We've already handled this file.
349 // the option `/nodefaultlib` than a reference to a file in the root
380 << ": is not a native COFF file. Recompile without /GL?";
383 Err(ctx) << "unknown file type: " << mb.getBufferIdentifier();
397 Fatal(ctx) << "could not get the buffer for the member defining symbol "
428 // Pass empty string as archive name so that the original filename is
429 // used as the buffer identifier.
443 void LinkerDriver::parseDirectives(InputFile *file) {
444 StringRef s = file->getDirectives();
448 Log(ctx) << "Directives: " << file << ": " << s;
456 // If a common header file contains dllexported function
460 if (!file->symtab.directivesExports.insert(e).second)
465 if (!isDecorated(exp.name))
466 exp.name = saver().save("_" + exp.name);
471 file->symtab.exports.push_back(exp);
476 file->symtab.addGCRoot(inc);
483 excludedSymbols.insert(file->symtab.mangle(sym));
501 Fatal(ctx) << "missing entry point symbol name";
507 checkFailIfMismatch(arg->getValue(), file);
510 file->symtab.addGCRoot(arg->getValue());
552 << toString(file) << ")";
557 // Find file from search paths. You can omit ".obj", this function takes
593 // Resolves a file path. This never returns the same path
621 // Find library file from search path.
623 // Add ".lib" to Filename if that has no file extension.
629 // looking for a MinGW formatted library name.
931 // The import name is calculated as follows:
935 // LINK | {value} | {value}.{.dll/.exe} | {output name}
936 // LIB | {value} | {value}.dll | {output name}.dll
963 e2.Name = std::string(e1.name);
1006 Fatal(ctx) << "cannot create temporary file for import library " << path
1042 // Parse an /order file. If an option is given, the linker places
1044 // given file.
1060 // Open a file.
1068 // Parse a file. An order file contains one symbol per line.
1069 // All symbols that were not present in a given order file are
1096 // Build a map from symbol name to section.
1098 for (ObjFile *file : ctx.objFileInstances)
1099 for (Symbol *sym : file->getSymbols())
1103 auto findSection = [&](StringRef name) -> SectionChunk * {
1104 Symbol *sym = map.lookup(name);
1107 Warn(ctx) << path << ": no such symbol: " << name;
1180 // Visit the address-significance table in each object file and mark each
1203 // If an object file does not have an address-significance table,
1245 // text between first and second % as variable name.
1281 ? "internal .obj file created from .res files"
1283 << ": more than one resource obj file not allowed, already got "
1289 // No resources to convert, and max one resource object file in
1301 void LinkerDriver::maybeCreateECExportThunk(StringRef name, Symbol *&sym) {
1315 if (auto mangledName = getArm64ECMangledFunctionName(name))
1318 expName = saver().save("EXP+" + name);
1364 maybeCreateECExportThunk(e.extName.empty() ? e.name : e.extName, e.sym);
1415 e.name = def->getName();
1425 // lld has a feature to create a tar file containing all input files as well as
1430 // name while /reproduce takes a full path. We have /linkrepro for compatibility
1443 // a repro tar file doesn't affect the main output.
1746 const StringRef name = nameFile.first;
1747 const std::string file = nameFile.second.str();
1748 config->namedStreams[name] = file;
2224 SmallString<256> buffer;
2225 raw_svector_ostream stream(buffer);
2234 Msg(ctx) << buffer;
2270 llvm::TimeTraceScope timeScope("Reproducer: response file");
2296 if (!isDecorated(e.name))
2297 e.name = saver().save("_" + e.name);
2317 // Handle generation of import library from a def file.
2326 // that from entry point name. Must happen before /entry handling,
2340 Fatal(ctx) << "missing entry point symbol name";
2352 // Windows specific -- If entry point name is not given, we need to
2353 // infer that from user-defined entry name.
2358 Log(ctx) << "Entry name inferred: " << s;
2378 // Set default image name if neither /out or /def set it.
2385 // Fail early if an output file is not writable.
2387 Err(ctx) << "cannot open output file " << config->outputFile << ": "
2406 Warn(ctx) << "/lldmap and /map have the same output file '"
2511 e.sym = symtab.addGCRoot(e.name, !e.data);
2543 // file's symbol table. If any of those library functions are defined in
2544 // a bitcode file in an archive member, we need to arrange to use LTO to
2588 // should only need to be run once, since each new object file imported
2591 // normal object file as well (although that won't be used for the
2636 // files" and not object files. Index file creation is already done
2663 // Make sure the crtend.o object is the last object file. This object
2664 // file can contain terminating section chunks that need to be placed
2667 // files from static libraries only after the last object file on the
2671 ObjFile *file = *i;
2672 if (isCrtend(file->getName())) {
2674 ctx.objFileInstances.push_back(file);
2680 // Windows specific -- when we are creating a .dll file, we also
2681 // need to create a .lib file. In MinGW mode, we only do that when the
2699 StringRef name = pair.first;
2702 Symbol *sym = ctx.symtab.find(name);
2704 Warn(ctx) << "/aligncomm symbol " << name << " not found";
2733 Err(ctx) << "/order and /call-graph-order-file may not be used together";
2738 // Handle /call-graph-ordering-file and /call-graph-profile-sort (default on).