GCC Middle and Back End API Reference
collect-utils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void notice (const char *,...) __attribute__((format(printf
 
void void fatal_signal (int)
 
void setup_signals (void)
 
struct pex_objcollect_execute (const char *, char **, const char *, const char *, int, bool, const char *)
 
int collect_wait (const char *, struct pex_obj *)
 
void do_wait (const char *, struct pex_obj *)
 
void fork_execute (const char *, char **, bool, const char *)
 
void utils_cleanup (bool)
 
void tool_cleanup (bool)
 
void maybe_unlink (const char *)
 

Variables

bool debug
 
bool verbose
 
bool save_temps
 
const chardumppfx
 
const char tool_name []
 

Function Documentation

◆ collect_execute()

struct pex_obj * collect_execute ( const char * prog,
char ** argv,
const char * outname,
const char * errname,
int flags,
bool use_atfile,
const char * atsuffix )
extern
Execute a program, and wait for the reply.   

References _, debug, dumppfx, errno, fatal_error(), fopen, free(), ggc_alloc(), input_location, notice(), NULL, response_file, and verbose.

Referenced by do_link(), fork_execute(), maybe_run_lto_and_relink(), and run_gcc().

◆ collect_wait()

int collect_wait ( const char * prog,
struct pex_obj * pex )
extern
Wait for a process to finish, and exit if a nonzero status is found.   

◆ do_wait()

◆ fatal_signal()

void void fatal_signal ( int signum)
extern
On fatal signals, delete all the temporary files.   

References ggc_alloc(), kill, and utils_cleanup().

Referenced by driver::global_initializations(), and setup_signals().

◆ fork_execute()

void fork_execute ( const char * prog,
char ** argv,
bool use_atfile,
const char * atsuffix )
extern

◆ maybe_unlink()

void maybe_unlink ( const char * file)
extern
Unlink FILE unless we are debugging or this is the output_file
and we may not unlink it.   
Unlink a temporary LTRANS file unless requested otherwise.   

References errno, fatal_error(), file_exists(), ggc_alloc(), input_location, may_unlink_output_file, notice(), output_file, and verbose.

Referenced by main(), maybe_unlink_list(), run_gcc(), and tool_cleanup().

◆ notice()

void notice ( const char * cmsgid,
... )
extern
Utility functions used by tools like collect2 and lto-wrapper.
   Copyright (C) 2009-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Provided in collect-utils.cc.   

◆ setup_signals()

void setup_signals ( void )
extern
Setup the signal handlers for the utils.  

References fatal_signal(), and ggc_alloc().

Referenced by main(), and main().

◆ tool_cleanup()

void tool_cleanup ( bool from_signal)
extern
Called by utils_cleanup.   
Delete tempfiles and exit function.   
Delete tempfiles.  Called from utils_cleanup.   

References c_file, early_debug_object_names, flto_out, free_array_of_ptrs(), ggc_alloc(), i, input_names, lto_o_files, ltrans_output_file, makefile, maybe_unlink(), maybe_unlink_list(), nr, num_deb_objs, o_file, offload_names, offload_objects_file_name, output_names, and verbose.

Referenced by collect_atexit(), and utils_cleanup().

◆ utils_cleanup()

void utils_cleanup ( bool from_signal)
extern
Delete tempfiles.   

References ggc_alloc(), and tool_cleanup().

Referenced by fatal_signal(), and lto_wrapper_cleanup().

Variable Documentation

◆ debug

◆ dumppfx

◆ save_temps

bool save_temps
extern

◆ tool_name

const char tool_name[]
extern
Provided by the tool itself.   
The name of the tool, printed in error messages.   

◆ verbose