[HIPIFY] Introduce '--' option - a separator between hipify-clang and clang options

+ Append '--' to the end of hipify-clang options in case of its absence.

[Reason]
+ Avoid the necessity for the user in JSON compilation database specification.
  Otherwise:
  Error while trying to load a compilation database:
  Could not auto-detect compilation database for file "test.cu"

  Though the hipification will be performed correctly without JSON database.


[ROCm/hip commit: aa4c59ae0c]
This commit is contained in:
Evgeny Mankov
2019-01-10 18:27:30 +03:00
szülő 36d1e34641
commit 3792d264c0
3 fájl változott, egészen pontosan 13 új sor hozzáadva és 0 régi sor törölve
@@ -68,6 +68,13 @@ std::string getAbsoluteDirectory(const std::string& sDir, std::error_code& EC,
}
int main(int argc, const char **argv) {
std::vector<const char*> new_argv(argv, argv + argc);
if (std::find(new_argv.begin(), new_argv.end(), std::string("--")) == new_argv.end()) {
new_argv.push_back("--");
new_argv.push_back(nullptr);
argv = new_argv.data();
argc++;
}
llcompat::PrintStackTraceOnErrorSignal();
ct::CommonOptionsParser OptionsParser(argc, argv, ToolTemplateCategory, llvm::cl::OneOrMore);
std::vector<std::string> fileSources = OptionsParser.getSourcePathList();