43e8a3bd3d
SWDEV-94189 - ORCA RT: do not use temp files This is memfile implementation, an interface to plug into libelf and emulate files in memory w/o any IO. If passed filename to open() is empty it will use in memory file, otherwise proxy it to the real file IO routine. This allows RT not to use temp files. Next this interface will be plugged to the finalizer. Testing: smoke, precheckin, conformance 2.0 reallyquick, test_compiler 1.2 with -legacy, test_compiler with -save-temps-all and -g -O0 -mem2reg=0 Reviewed by Evgeny Mankov Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.cpp#34 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.hpp#23 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf_utils.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/_libelf_config.h#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/build/Makefile.libelf#5 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/elf_update.c#12 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/memfile.cpp#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/memfile.h#1 add
31 lignes
776 B
C
31 lignes
776 B
C
//
|
|
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
|
|
#ifndef _MEMFILE_H
|
|
#define _MEMFILE_H
|
|
|
|
#include <sys/types.h>
|
|
#if !defined(_MSC_VER)
|
|
#include <sys/stat.h>
|
|
#endif
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Acts the same as open(), but path can be NULL, which is a request for in memory file
|
|
extern int mem_open(const char *path, int oflag, int pmode);
|
|
extern off_t mem_read(int fd, void *buffer, size_t count);
|
|
extern off_t mem_write(int fd, const void *buffer, size_t count);
|
|
extern int mem_close(int fd);
|
|
extern off_t mem_lseek(int fd, off_t offset, int origin);
|
|
extern int mem_fstat(int fd, struct stat *buf);
|
|
extern int mem_ftruncate(int fd, size_t len);
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
#endif
|
|
|
|
#endif // !_MEMFILE_H
|