1. fixed file extension search bug

2. added new dependency
This commit is contained in:
dfukalov
2016-03-03 18:28:24 +03:00
parent b90ee96510
commit 5db0984077
2 changed files with 6 additions and 8 deletions
+1
View File
@@ -41,6 +41,7 @@ target_link_libraries(hipify
clangToolingCore
clangRewrite
clangBasic
LLVMProfileData
LLVMSupport
LLVMMCParser
LLVMMC
+5 -8
View File
@@ -611,7 +611,7 @@ int main(int argc, const char **argv) {
std::vector<std::string> fileSources = OptionsParser.getSourcePathList();
if (dst.empty()) {
dst = fileSources[0];
size_t pos = dst.find(".cu");
size_t pos = dst.rfind(".cu");
if (pos != std::string::npos) {
dst = dst.substr(0, pos) + ".hip.cu";
} else {
@@ -656,7 +656,7 @@ int main(int argc, const char **argv) {
Tool.appendArgumentsAdjuster(getClangSyntaxOnlyAdjuster());
Result = Tool.run(action.get());
Tool.clearArgumentsAdjusters();
Tool.clearArgumentsAdjusters();
}
LangOptions DefaultLangOptions;
@@ -680,13 +680,10 @@ int main(int argc, const char **argv) {
Result = Rewrite.overwriteChangedFiles();
size_t pos = dst.rfind(".cu");
if (pos != std::string::npos)
{
size_t pos = dst.find(".cu");
if (pos != std::string::npos)
{
rename(dst.c_str(), dst.substr(0, pos).c_str());
}
rename(dst.c_str(), dst.substr(0, pos).c_str());
}
return Result;
}