[HIPIFY] Introduce '-I' option as hipify-clang's one

+ '-I' might be set as hipify-clang option (before separator '--' or without specifying separator at all);
+ '-I' as a clang option might be specified as well (after options separator '--').
This commit is contained in:
Evgeny Mankov
2019-01-14 18:23:54 +03:00
parent ebf6a8b8fe
commit 93aeb04cec
4 changed files with 14 additions and 1 deletions
-1
View File
@@ -321,7 +321,6 @@ For example:
./hipify-clang \
square.cu \
--cuda-path=/usr/local/cuda-8.0 \
-- \
-I /usr/local/cuda-8.0/samples/common/inc
```
+7
View File
@@ -89,4 +89,11 @@ cl::opt<bool> DashDash("-",
cl::value_desc("--"),
cl::cat(ToolTemplateCategory));
cl::list<std::string> I("I",
cl::desc("Add directory to include search path"),
cl::value_desc("directory"),
cl::ZeroOrMore,
cl::Prefix,
cl::cat(ToolTemplateCategory));
cl::extrahelp CommonHelp(ct::CommonOptionsParser::HelpMessage);
+1
View File
@@ -33,6 +33,7 @@ extern cl::opt<std::string> OutputFilename;
extern cl::opt<std::string> OutputDir;
extern cl::opt<std::string> TemporaryDir;
extern cl::opt<std::string> CudaPath;
extern cl::list<std::string> I;
extern cl::opt<bool> Inplace;
extern cl::opt<bool> SaveTemps;
extern cl::opt<bool> NoBackup;
+6
View File
@@ -199,6 +199,12 @@ int main(int argc, const char **argv) {
#if defined(HIPIFY_CLANG_RES)
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-resource-dir=" HIPIFY_CLANG_RES));
#endif
if (!I.empty()) {
for (std::string s : I) {
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-I", ct::ArgumentInsertPosition::END));
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster(s.c_str(), ct::ArgumentInsertPosition::END));
}
}
Tool.appendArgumentsAdjuster(ct::getClangSyntaxOnlyAdjuster());
Statistics& currentStat = Statistics::current();
// Hipify _all_ the things!