From ce28bc79efd16f7ec95925544ca383e504e63cc2 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 30 Jan 2019 15:19:06 +0300 Subject: [PATCH] [HIPIFY] Introduce Verbose '-v' option as hipify's own --- hipify-clang/src/ArgParse.cpp | 5 +++++ hipify-clang/src/ArgParse.h | 1 + hipify-clang/src/main.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/hipify-clang/src/ArgParse.cpp b/hipify-clang/src/ArgParse.cpp index 3cc372adab..bcd1457ec4 100644 --- a/hipify-clang/src/ArgParse.cpp +++ b/hipify-clang/src/ArgParse.cpp @@ -49,6 +49,11 @@ cl::opt SaveTemps("save-temps", cl::value_desc("save-temps"), cl::cat(ToolTemplateCategory)); +cl::opt Verbose("v", + cl::desc("Show commands to run and use verbose output"), + cl::value_desc("v"), + cl::cat(ToolTemplateCategory)); + cl::opt TranslateToRoc("roc", cl::desc("Translate to roc instead of hip where it is possible"), cl::value_desc("roc"), diff --git a/hipify-clang/src/ArgParse.h b/hipify-clang/src/ArgParse.h index d4e666c968..11d84c8e33 100644 --- a/hipify-clang/src/ArgParse.h +++ b/hipify-clang/src/ArgParse.h @@ -37,6 +37,7 @@ extern cl::list IncludeDirs; extern cl::list MacroNames; extern cl::opt Inplace; extern cl::opt SaveTemps; +extern cl::opt Verbose; extern cl::opt NoBackup; extern cl::opt NoOutput; extern cl::opt PrintStats; diff --git a/hipify-clang/src/main.cpp b/hipify-clang/src/main.cpp index 6df2f57073..3b832deb8f 100644 --- a/hipify-clang/src/main.cpp +++ b/hipify-clang/src/main.cpp @@ -234,6 +234,9 @@ int main(int argc, const char **argv) { Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster(s.c_str(), ct::ArgumentInsertPosition::END)); } } + if (Verbose) { + Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-v", ct::ArgumentInsertPosition::END)); + } Tool.appendArgumentsAdjuster(ct::getClangSyntaxOnlyAdjuster()); Statistics& currentStat = Statistics::current(); // Hipify _all_ the things!