GCC Middle and Back End API Reference
lto-ltrans-cache.cc File Reference
#include "config.h"
#include "system.h"
#include "sha1.h"
#include "lto-ltrans-cache.h"
Include dependency graph for lto-ltrans-cache.cc:

Macros

#define INCLUDE_ALGORITHM
 
#define INCLUDE_STRING
 
#define INCLUDE_ARRAY
 
#define INCLUDE_MAP
 
#define INCLUDE_VECTOR
 

Functions

static checksum_t file_checksum (char const *filename)
 
static bool files_identical (char const *first_filename, char const *second_filename)
 
static ltrans_file_cache::itemread_cache_item (FILE *f, const char *dir)
 
static void write_cache_item (FILE *f, ltrans_file_cache::item *item, const char *dir)
 
static int file_exists (char const *name)
 

Variables

static const checksum_t NULL_CHECKSUM
 

Macro Definition Documentation

◆ INCLUDE_ALGORITHM

#define INCLUDE_ALGORITHM
File caching.
   Copyright (C) 2023-2025 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/>.   

◆ INCLUDE_ARRAY

#define INCLUDE_ARRAY

◆ INCLUDE_MAP

#define INCLUDE_MAP

◆ INCLUDE_STRING

#define INCLUDE_STRING

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR

Function Documentation

◆ file_checksum()

static checksum_t file_checksum ( char const * filename)
static
Computes checksum for given file, returns NULL_CHECKSUM if not
possible.   

References fopen, and NULL_CHECKSUM.

Referenced by ltrans_file_cache::add_to_cache().

◆ file_exists()

static int file_exists ( char const * name)
static
Returns true if file exists.   

References R_OK.

◆ files_identical()

static bool files_identical ( char const * first_filename,
char const * second_filename )
static
Checks identity of two files.   

References fopen, free(), map, MAP_FAILED, NULL, O_RDONLY, and S_ISREG.

Referenced by ltrans_file_cache::add_to_cache().

◆ read_cache_item()

static ltrans_file_cache::item * read_cache_item ( FILE * f,
const char * dir )
static
Reads next cache item from cachedata file.
Adds `dir/` prefix to filenames.   

References ltrans_file_cache::dir, and NULL.

Referenced by ltrans_file_cache::load_cache().

◆ write_cache_item()

static void write_cache_item ( FILE * f,
ltrans_file_cache::item * item,
const char * dir )
static

Variable Documentation

◆ NULL_CHECKSUM

const checksum_t NULL_CHECKSUM
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}

Referenced by file_checksum().