Set ERROR in retValForCrash in SafetyGuard.call()

- allows to print ocloc command line after crash in compilation

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2022-02-02 13:09:00 +00:00
committed by Compute-Runtime-Automation
parent 8540aaff1c
commit 31a61a16c0
6 changed files with 18 additions and 14 deletions

View File

@@ -17,6 +17,7 @@ enum {
INVALID_PROGRAM = -44,
INVALID_COMMAND_LINE = -5150,
INVALID_FILE = -5151,
COMPILATION_CRASH = -5152,
};
} // namespace NEO::OclocErrorCode

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/offline_compiler/source/ocloc_error_code.h"
#include "shared/offline_compiler/source/offline_compiler.h"
#include "shared/offline_compiler/source/offline_linker.h"
#include "shared/offline_compiler/source/utilities/linux/safety_guard_linux.h"
@@ -14,14 +15,14 @@ using namespace NEO;
int buildWithSafetyGuard(OfflineCompiler *compiler) {
SafetyGuardLinux safetyGuard;
int retVal = 0;
int retVal = NEO::OclocErrorCode::COMPILATION_CRASH;
return safetyGuard.call<int, OfflineCompiler, decltype(&OfflineCompiler::build)>(compiler, &OfflineCompiler::build, retVal);
}
int linkWithSafetyGuard(OfflineLinker *linker) {
SafetyGuardLinux safetyGuard{};
int returnValueOnCrash{-1};
int returnValueOnCrash{NEO::OclocErrorCode::COMPILATION_CRASH};
return safetyGuard.call(linker, &OfflineLinker::execute, returnValueOnCrash);
}

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/offline_compiler/source/ocloc_error_code.h"
#include "shared/offline_compiler/source/offline_compiler.h"
#include "shared/offline_compiler/source/offline_linker.h"
#include "shared/offline_compiler/source/utilities/windows/safety_guard_windows.h"
@@ -13,13 +14,13 @@ using namespace NEO;
int buildWithSafetyGuard(OfflineCompiler *compiler) {
SafetyGuardWindows safetyGuard;
int retVal = 0;
int retVal = NEO::OclocErrorCode::COMPILATION_CRASH;
return safetyGuard.call<int, OfflineCompiler, decltype(&OfflineCompiler::build)>(compiler, &OfflineCompiler::build, retVal);
}
int linkWithSafetyGuard(OfflineLinker *linker) {
SafetyGuardWindows safetyGuard{};
int returnValueOnCrash{-1};
int returnValueOnCrash{NEO::OclocErrorCode::COMPILATION_CRASH};
return safetyGuard.call(linker, &OfflineLinker::execute, returnValueOnCrash);
}