| 261 | } |
| 262 | |
| 263 | bool Program::linkLLVMBitcode(const amd_comgr_data_set_t inputs, |
| 264 | const std::vector<std::string>& options, |
| 265 | amd::option::Options* amdOptions, amd_comgr_data_set_t* output, |
| 266 | char* binaryData[], size_t* binarySize) { |
| 267 | amd_comgr_language_t langver = getCOMGRLanguage(isHIP(), *amdOptions); |
| 268 | if (langver == AMD_COMGR_LANGUAGE_NONE) { |
| 269 | return false; |
| 270 | } |
| 271 | |
| 272 | // Create the action for linking |
| 273 | amd_comgr_action_info_t action; |
| 274 | bool hasAction = false; |
| 275 | |
| 276 | amd_comgr_status_t status = createAction(langver, options, &action, &hasAction); |
| 277 | |
| 278 | if (status == AMD_COMGR_STATUS_SUCCESS) { |
| 279 | status = amd::Comgr::do_action(AMD_COMGR_ACTION_LINK_BC_TO_BC, action, inputs, *output); |
| 280 | extractBuildLog(*output); |
| 281 | } |
| 282 | |
| 283 | if (status == AMD_COMGR_STATUS_SUCCESS) { |
| 284 | std::string dumpFileName; |
| 285 | if (amdOptions->isDumpFlagSet(amd::option::DUMP_BC_LINKED)) { |
| 286 | dumpFileName = amdOptions->getDumpFileName("_linked.bc"); |
| 287 | } |
| 288 | status = extractByteCodeBinary(*output, AMD_COMGR_DATA_KIND_BC, dumpFileName, binaryData, |
| 289 | binarySize); |
| 290 | } |
| 291 | |
| 292 | if (hasAction) { |
| 293 | amd::Comgr::destroy_action_info(action); |
| 294 | } |
| 295 | |
| 296 | return (status == AMD_COMGR_STATUS_SUCCESS); |
| 297 | } |
| 298 | |
| 299 | bool Program::compileToLLVMBitcode(const amd_comgr_data_set_t compileInputs, |
| 300 | const std::vector<std::string>& options, |
nothing calls this directly
no test coverage detected