Reimplementation of Elf Writer

- remove is_initialize pattern
- add RAII
- replace dynamic arrays with std::vector<char>
- use fixed width integer types
- remove c-style casting
- reducing the number of code checks
- add camelCase style

Change-Id: If24a595f03865c59c86fed29db280de0084b5663
This commit is contained in:
Kamil Diedrich
2018-07-27 22:59:40 +02:00
committed by sys_ocldev
parent 392277ff00
commit 8226269bbe
14 changed files with 304 additions and 676 deletions

View File

@@ -29,6 +29,7 @@
#include "runtime/helpers/base_object.h"
#include "runtime/helpers/stdio.h"
#include "runtime/helpers/string_helpers.h"
#include "elf/writer.h"
#include "igfxfmid.h"
#include "patch_list.h"
#include <vector>
@@ -178,6 +179,8 @@ class Program : public BaseObject<_cl_program> {
cl_int getSource(char *&pBinary, unsigned int &dataSize) const;
cl_int getSource(std::string &binary) const;
void storeGenBinary(const void *pSrc, const size_t srcSize);
char *getGenBinary(size_t &genBinarySize) const {
@@ -297,7 +300,7 @@ class Program : public BaseObject<_cl_program> {
// clang-format off
cl_program_binary_type programBinaryType;
bool isSpirV = false;
char* elfBinary;
CLElfLib::ElfBinaryStorage elfBinary;
size_t elfBinarySize;
char* genBinary;