[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user