Lines Matching defs:File
5 // This file is distributed under the University of Illinois Open Source
87 std::unique_ptr<ld_plugin_input_file> File;
90 File = llvm::make_unique<ld_plugin_input_file>();
91 if (get_input_file(Handle, File.get()) != LDPS_OK)
92 message(LDPL_FATAL, "Failed to get file information");
95 // File would have been reset to nullptr if we moved this object
97 if (File)
99 message(LDPL_FATAL, "Failed to release file information");
102 ld_plugin_input_file &file() { return *File; }
124 /// The file name corresponding to the output stream, used during cleanup.
127 /// Flag indicating whether the output file is a temp file that must be
192 // also generate a "${bitcodefile}.imports" file at the same location for each
193 // bitcode file, listing the files it imports from in plain text. This is to
194 // support distributed build file staging.
200 // corresponding bitcode file, will use a path formed by replacing the
201 // bitcode file's path prefix matching oldprefix with newprefix.
206 // For example, "generate-api-file" and "as"options are for the plugin
216 if (opt == "generate-api-file") {
263 static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
304 message(LDPL_ERROR, "Unknown output file type %d", tv->tv_u.tv_val);
454 /// Called by gold to see whether this file is one that our plugin can handle.
457 static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
464 if (get_view(file->handle, &view) != LDPS_OK) {
465 message(LDPL_ERROR, "Failed to get a view of %s", file->name);
469 MemoryBufferRef(StringRef((const char *)view, file->filesize), "");
472 file, such as
474 if (file->offset) {
475 offset = file->offset;
478 MemoryBuffer::getOpenFileSlice(file->fd, file->name, file->filesize,
508 cf.handle = file->handle;
509 // Keep track of the first handle for each file descriptor, since there are
511 // ThinLTO parallel backends to ensure that each file is only opened and
514 FDToLeaderHandle.insert(std::make_pair(file->fd, file->handle)).first;
518 cf.filesize = file->filesize;
520 // non-zero offset, which we can append to the file name to obtain a
522 cf.name = file->name;
523 if (file->offset)
524 cf.name += ".llvm." + std::to_string(file->offset) + "." +
645 /// Helper to get a file's symbols and a view into it via gold callbacks.
656 message(LDPL_FATAL, "Failed to get a view of file");
670 // in this bitcode file.
681 "Could not read module summary index bitcode from file : %s",
699 message(LDPL_FATAL, "Could not read bitcode from file : %s",
834 message(LDPL_FATAL, "Failed to write the output file.");
841 "Unable to add .o file to the link. File left behind in: %s",
848 // Close the output file descriptor before we pass it to gold.
874 /// a unique and identifiable save-temps output file for each ThinLTO backend.
911 /// Invoke the actual code generation to emit Module's object to file.
1031 /// Open a file and return the new file descriptor given a base input
1032 /// file name, a flag indicating whether a temp file should be generated,
1042 message(LDPL_FATAL, "Could not create temporary file: %s",
1051 message(LDPL_FATAL, "Could not open file: %s", EC.message().c_str());
1057 assert(OS && "Output stream must be set before emitting to file");
1083 // Open a file descriptor for each backend task. This is done in a block
1084 // so that the output file descriptors are closed before gold opens them.
1138 /// Links the module in \p View from file \p F into the combined module
1156 // For ThinLTO we want to propagate the source file name to ensure
1238 // Use the input file name so that we get a unique and identifiable
1239 // output file for each ThinLTO backend task.
1283 /// Given the original \p Path to an output file, replace any path
1303 /// Perform ThinLTO link, which creates the combined index file.
1310 // Map to own RAII objects that manage the file opening and releasing
1412 // For each input bitcode file, generate an individual index that
1463 /// native object file. Then, perform optimization and codegen.
1485 // RAII object to manage the file opening and releasing interfaces with
1542 // Remove the output file here since ld.bfd creates the output file