Ignore:
Timestamp:
Jun 28, 2018, 9:56:01 AM (18 months ago)
Author:
matszpk
Message:

CLRadeonExtender: BinGen?: Change BinGen? constructors to be more portable and easier modifiable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3796 r4430  
    2727#include <algorithm>
    2828#include <utility>
     29#include <memory>
    2930#include <unordered_set>
    3031#include <CLRX/amdbin/ElfBinaries.h>
     
    20422043        rocmGotGen(nullptr), rocmRelaDynGen(nullptr)
    20432044{
    2044     input = new ROCmInput{ deviceType, archMinor, archStepping, 0, false,
    2045             globalDataSize, globalData, symbols, codeSize, code };
     2045    std::unique_ptr<ROCmInput> _input(new ROCmInput{});
     2046    _input->deviceType = deviceType;
     2047    _input->archMinor = archMinor;
     2048    _input->archStepping = archStepping;
     2049    _input->eflags = 0;
     2050    _input->newBinFormat = false;
     2051    _input->globalDataSize = globalDataSize;
     2052    _input->globalData = globalData;
     2053    _input->symbols = symbols;
     2054    _input->codeSize = codeSize;
     2055    _input->code = code;
     2056    _input->commentSize = 0;
     2057    _input->comment = nullptr;
     2058    _input->target = "";
     2059    _input->targetTripple = "";
     2060    _input->metadataSize = 0;
     2061    _input->metadata = nullptr;
     2062    _input->useMetadataInfo = false;
     2063    _input->metadataInfo = ROCmMetadata{};
     2064    input = _input.release();
    20462065}
    20472066
     
    20522071        rocmGotGen(nullptr), rocmRelaDynGen(nullptr)
    20532072{
    2054     input = new ROCmInput{ deviceType, archMinor, archStepping, 0, false,
    2055             globalDataSize, globalData, std::move(symbols), codeSize, code };
     2073    std::unique_ptr<ROCmInput> _input(new ROCmInput{});
     2074    _input->deviceType = deviceType;
     2075    _input->archMinor = archMinor;
     2076    _input->archStepping = archStepping;
     2077    _input->eflags = 0;
     2078    _input->newBinFormat = false;
     2079    _input->globalDataSize = globalDataSize;
     2080    _input->globalData = globalData;
     2081    _input->symbols = std::move(symbols);
     2082    _input->codeSize = codeSize;
     2083    _input->code = code;
     2084    _input->commentSize = 0;
     2085    _input->comment = nullptr;
     2086    _input->target = "";
     2087    _input->targetTripple = "";
     2088    _input->metadataSize = 0;
     2089    _input->metadata = nullptr;
     2090    _input->useMetadataInfo = false;
     2091    _input->metadataInfo = ROCmMetadata{};
     2092    input = _input.release();
    20562093}
    20572094
Note: See TracChangeset for help on using the changeset viewer.