Lines Matching +defs:buffer +defs:file +defs:name

88 static std::optional<StringRef> findLibrary(StringRef name) {
89 CachedHashStringRef key(name);
97 if (name.ends_with(".o"))
98 return findPathCombination(name, config->librarySearchPaths, {""});
101 findPathCombination("lib" + name, config->librarySearchPaths,
104 return findPathCombination("lib" + name, config->librarySearchPaths,
107 return findPathCombination("lib" + name, config->librarySearchPaths,
119 static std::optional<StringRef> findFramework(StringRef name) {
120 CachedHashStringRef key(name);
127 std::tie(name, suffix) = name.split(",");
130 path::append(symlink, name + ".framework", name);
173 SmallString<261> buffer(root);
174 path::append(buffer, path);
176 if (fs::is_directory(buffer)) {
177 paths.push_back(saver().save(buffer.str()));
192 SmallString<261> buffer(root);
193 path::append(buffer, path);
194 if (fs::is_directory(buffer))
195 paths.push_back(saver().save(buffer.str()));
269 ArchiveFile *file;
275 static void saveThinArchiveToRepro(ArchiveFile const *file) {
276 assert(tar && file->getArchive().isThin());
279 for (const object::Archive::Child &c : file->getArchive().children(e)) {
281 toString(file) + ": failed to get buffer");
282 tar->append(relativeToRoot(CHECK(c.getFullName(), file)), mb.getBuffer());
285 error(toString(file) +
293 std::optional<MemoryBufferRef> buffer = readFile(path);
294 if (!buffer)
296 MemoryBufferRef mbref = *buffer;
311 ArchiveFile *file;
319 file = make<ArchiveFile>(std::move(archive), isForceHidden);
321 if (tar && file->getArchive().isThin())
322 saveThinArchiveToRepro(file);
324 file = entry->second.file;
325 // Command-line loads take precedence. If file is previously loaded via
329 return file;
339 for (const object::Archive::Child &c : file->getArchive().children(e)) {
352 if (Error e = file->fetch(c, reason)) {
354 warn(toString(file) + ": " + reason +
361 error(toString(file) +
365 for (const object::Archive::Symbol &sym : file->getArchive().symbols())
367 file->fetch(sym);
373 for (const object::Archive::Child &c : file->getArchive().children(e)) {
379 warn(toString(file) + ": -ObjC failed to open archive member: " +
388 if (Error e = file->fetch(c, "-ObjC"))
389 error(toString(file) + ": -ObjC failed to load archive member: " +
393 error(toString(file) +
398 file->addLazySymbols();
399 loadedArchives[path] = ArchiveFileInfo{file, isCommandLineLoad};
400 newFile = file;
421 error(path + ": unhandled file type");
426 error(path + ": unhandled file type");
441 // print the .a name here. Similarly skip lazy files.
450 static void addLibrary(StringRef name, bool isNeeded, bool isWeak,
453 if (std::optional<StringRef> path = findLibrary(name)) {
470 saver().save("auto-linked library not found for -l" + name));
473 error("library not found for -l" + name);
477 static void addFramework(StringRef name, bool isNeeded, bool isWeak,
479 if (std::optional<StringRef> path = findFramework(name)) {
483 InputFile *file =
485 if (auto *dylibFile = dyn_cast_or_null<DylibFile>(file)) {
494 } else if (isa_and_nonnull<ObjFile>(file) ||
495 isa_and_nonnull<BitcodeFile>(file)) {
507 saver().save("auto-linked framework not found for -framework " + name));
510 error("framework not found for -framework " + name);
537 StringRef name = argv[++i];
538 if (config->ignoreAutoLinkOptions.contains(name))
560 StringRef name = LCLinkerOptions[++i];
561 assert(!config->ignoreAutoLinkOptions.contains(name));
562 addFramework(name, /*isNeeded=*/false, /*isWeak=*/false,
573 std::optional<MemoryBufferRef> buffer = readFile(path);
574 if (!buffer)
576 MemoryBufferRef mbref = *buffer;
586 for (InputFile *file : inputFiles) {
587 if (auto *dylibFile = dyn_cast<DylibFile>(file)) {
613 for (InputFile *file : inputFiles)
614 if (auto *bitcodeFile = dyn_cast<BitcodeFile>(file))
615 if (!file->lazy)
619 for (ObjFile *file : compiled)
620 inputFiles.insert(file);
1180 error("invalid symbol-name pattern: " + symbolName);
1201 std::optional<MemoryBufferRef> buffer = readFile(path);
1202 if (!buffer) {
1203 error("Could not read symbol file: " + path);
1206 MemoryBufferRef mbref = *buffer;
1308 for (const InputFile *file : inputFiles) {
1309 for (const Section *section : file->sections) {
1312 if (section->name == section_names::compactUnwind)
1315 if (section->name == section_names::addrSig)
1320 if (!file->objCImageInfo.empty())
1321 in.objCImageInfo->addFile(file);
1396 Section &section = *make<Section>(/*file=*/nullptr, segment_names::text,
1425 symtab->addUndefined("dyld_stub_binder", /*file=*/nullptr, /*isWeak=*/false);
1444 for (const InputFile *file : inputFiles) {
1445 if (auto *objFile = dyn_cast<ObjFile>(file)) {
1711 arg->getValue(), /*file=*/nullptr, /*isWeakRef=*/false));
1912 ": ignored, only has effect with -dylib [--warn-dylib-install-name]");
1948 /*file=*/nullptr,
1974 error("invalid name for segment or section: " + s);
2072 symtab->addUndefined(cachedName.val(), /*file=*/nullptr,
2165 // files" and not object files. Index file creation is already done
2170 // LTO may emit a non-hidden (extern) object file symbol even if the
2191 std::optional<MemoryBufferRef> buffer = readFile(fileName);
2192 if (buffer)
2193 inputFiles.insert(make<OpaqueFile>(*buffer, segName, sectName));
2241 // Write to an output file.