P4 to Git Change 1191624 by emankov@em-hsa-amd on 2015/09/17 08:40:13

ECR #333753 - Compiler Lib: Bug 10998 - Add a way to pass options to finalizer (-Wh,-finalizer-option)

	Works only for HSAIL path.

	Testing: complib -Wh, pre check-in

	Reviewer: Nikolay Haustov

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.cpp#52 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/OPTIONS.def#131 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.hpp#18 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-Wh/HelloWorld_Kernel_cl.cl#1 add
... //depot/stg/opencl/drivers/opencl/tests/hsa/tlst/complib.tlst#15 edit
This commit is contained in:
foreman
2015-09-17 08:46:23 -04:00
parent a2dc72376a
commit 087722ed49
3 changed files with 30 additions and 5 deletions
+13 -1
View File
@@ -267,7 +267,7 @@ ShowOptionsHelp(const char* helpValue, Options& Opts)
std::string pntVal;
switch (OPTION_type(od)) {
case OT_CSTRING:
if ((i == OID_WFComma) || (i == OID_WBComma)) {
if ((i == OID_WFComma) || (i == OID_WBComma) || (i == OID_WHComma)) {
pntVal = "<options>";
}
else if (i == OID_SaveTemps) {
@@ -858,6 +858,7 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
case OID_WFComma:
case OID_WBComma:
case OID_WHComma:
if (sval != NULL) {
// we know that sval was new'ed
for (char* p=(char*)sval; *p; ++p) {
@@ -878,6 +879,9 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
Opts.llvmOptions.append(" ");
Opts.llvmOptions.append(sval);
}
else if (((OptionIdentifier)OptDescTableIx) == OID_WHComma) {
Opts.finalizerOptions.push_back(sval);
}
}
break;
@@ -1587,6 +1591,14 @@ bool Options::setOptionVariablesAs(const Options& other)
return true;
}
std::string Options::getStringFromStringVec(std::vector<std::string>& stringVec)
{
const char* const delim = " ";
std::ostringstream strstr;
std::copy(stringVec.begin(), stringVec.end(), std::ostream_iterator<std::string>(strstr, delim));
return strstr.str();
}
} // option
}// amd