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
[ROCm/clr commit: 087722ed49]
Этот коммит содержится в:
@@ -526,6 +526,14 @@ OPTION(OT_CSTRING, \
|
||||
0, 0, 0, NULL, \
|
||||
"Pass comma-separated <options> to the backend (llvm)")
|
||||
|
||||
// -Wh,<options> : pass comma-separated <options> to the finalizer (sc)
|
||||
OPTION(OT_CSTRING, \
|
||||
OA_RUNTIME|OVIS_SUPPORT|OVA_REQUIRED|OA_SEPARATOR_NONE, \
|
||||
"Wh,", NULL, \
|
||||
WHComma, \
|
||||
0, 0, 0, NULL, \
|
||||
"Pass comma-separated <options> to the finalizer (sc)")
|
||||
|
||||
// -O[0|1|2|3|4|5]
|
||||
OPTION(OT_UINT32, \
|
||||
OA_RUNTIME|OVA_OPTIONAL|OA_SEPARATOR_NONE, \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -198,10 +198,11 @@ class Options {
|
||||
public:
|
||||
std::string origOptionStr;
|
||||
|
||||
OptionVariables *oVariables; // pointer to a struct of all option variables
|
||||
std::string clcOptions; // options passed into EDG frontend (clc)
|
||||
std::vector<std::string> clangOptions; // Options passed into Clang frontend.
|
||||
std::string llvmOptions; // options passed into backend (llvm)
|
||||
OptionVariables *oVariables; // pointer to a struct of all option variables
|
||||
std::string clcOptions; // options passed into EDG frontend (clc)
|
||||
std::vector<std::string> clangOptions; // options passed into Clang frontend
|
||||
std::string llvmOptions; // options passed into backend (llvm)
|
||||
std::vector<std::string> finalizerOptions; // options passed into finalizer
|
||||
|
||||
// Given as build option
|
||||
int WorkGroupSize[3]; // -1: use default
|
||||
@@ -279,6 +280,8 @@ public:
|
||||
// Set the option variables same as defined in "other"
|
||||
bool setOptionVariablesAs(const Options& other);
|
||||
|
||||
std::string getFinalizerOptions() { return getStringFromStringVec(finalizerOptions); }
|
||||
|
||||
private:
|
||||
std::string fullPath, baseName;
|
||||
long basename_max;
|
||||
@@ -310,7 +313,9 @@ private:
|
||||
(f & DUMP_ENCRYPT));
|
||||
}
|
||||
|
||||
std::string getStringFromStringVec(std::vector<std::string>& stringVec);
|
||||
void setDumpFileName(const char* val);
|
||||
|
||||
public:
|
||||
LibrarySelector libraryType_;
|
||||
std::string sourceFileName_;
|
||||
|
||||
Ссылка в новой задаче
Block a user