diff --git a/projects/clr/rocclr/compiler/lib/utils/OPTIONS.def b/projects/clr/rocclr/compiler/lib/utils/OPTIONS.def index 9d31dafcae..bd9afe5459 100644 --- a/projects/clr/rocclr/compiler/lib/utils/OPTIONS.def +++ b/projects/clr/rocclr/compiler/lib/utils/OPTIONS.def @@ -526,6 +526,14 @@ OPTION(OT_CSTRING, \ 0, 0, 0, NULL, \ "Pass comma-separated to the backend (llvm)") +// -Wh, : pass comma-separated 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 to the finalizer (sc)") + // -O[0|1|2|3|4|5] OPTION(OT_UINT32, \ OA_RUNTIME|OVA_OPTIONAL|OA_SEPARATOR_NONE, \ diff --git a/projects/clr/rocclr/compiler/lib/utils/options.cpp b/projects/clr/rocclr/compiler/lib/utils/options.cpp index 810baf7960..f23ca1be32 100644 --- a/projects/clr/rocclr/compiler/lib/utils/options.cpp +++ b/projects/clr/rocclr/compiler/lib/utils/options.cpp @@ -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 = ""; } 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& stringVec) +{ + const char* const delim = " "; + std::ostringstream strstr; + std::copy(stringVec.begin(), stringVec.end(), std::ostream_iterator(strstr, delim)); + return strstr.str(); +} + } // option }// amd diff --git a/projects/clr/rocclr/compiler/lib/utils/options.hpp b/projects/clr/rocclr/compiler/lib/utils/options.hpp index de8af867b3..ceb4a9b34d 100644 --- a/projects/clr/rocclr/compiler/lib/utils/options.hpp +++ b/projects/clr/rocclr/compiler/lib/utils/options.hpp @@ -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 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 clangOptions; // options passed into Clang frontend + std::string llvmOptions; // options passed into backend (llvm) + std::vector 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& stringVec); void setDumpFileName(const char* val); + public: LibrarySelector libraryType_; std::string sourceFileName_;