P4 to Git Change 1077270 by emankov@em-hsa-amd on 2014/09/16 09:26:09
ECR #333753 - Compiler Lib: Bug fix in string options comparison
Tests: smoke, precheck-in
Reviewer: Brian Sumner, Artem Tamazov
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.hpp#15 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpucompiler.cpp#149 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#176 edit
[ROCm/clr commit: 9c02c73c2f]
Tá an tiomantas seo le fáil i:
@@ -1489,10 +1489,14 @@ Options::getDumpFileName(const std::string& ext)
|
||||
}
|
||||
|
||||
bool
|
||||
Options::isCStrEqual(const char *cs1, const char* cs2)
|
||||
Options::isCStrOptionsEqual(const char *cs1, const char* cs2) const
|
||||
{
|
||||
if ((cs1 != NULL) && (cs2 != NULL)) {
|
||||
return (strcmp(cs1, cs2) == 0);
|
||||
} else if ((cs1 == NULL || strcmp(cs1,"") == 0) &&
|
||||
(cs2 == NULL || strcmp(cs2,"") == 0)) {
|
||||
// consider empty string and NULL ptr (no string) as equal
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1527,7 +1531,7 @@ bool Options::equals(const Options& other, bool ignoreClcOptions) const
|
||||
else if (OPTION_type(od) == OT_CSTRING) {
|
||||
OT_CSTRING_t* o = reinterpret_cast<OT_CSTRING_t*>(addr);
|
||||
OT_CSTRING_t* o2 = reinterpret_cast<OT_CSTRING_t*>(addr2);
|
||||
if (*o != *o2) return false;
|
||||
if (!isCStrOptionsEqual(*o,*o2)) return false;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
std::string getDumpFileName(const std::string& ext);
|
||||
|
||||
void setPerBuildInfo(const char* val, int encrypt, bool device);
|
||||
bool isCStrEqual(const char *cs1, const char* cs2);
|
||||
bool isCStrOptionsEqual(const char *cs1, const char* cs2) const;
|
||||
|
||||
|
||||
bool useDefaultWGS() { return UseDefaultWGS; }
|
||||
|
||||
@@ -1300,7 +1300,7 @@ NullProgram::parseAllILFuncs(const std::string& source)
|
||||
{
|
||||
bool doPatch = true;
|
||||
amd::option::Options *opts = getCompilerOptions();
|
||||
if (opts->isCStrEqual(opts->oVariables->XLang, "il")) {
|
||||
if (opts->isCStrOptionsEqual(opts->oVariables->XLang, "il")) {
|
||||
doPatch = false;
|
||||
}
|
||||
// Find the patch position
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir