[HIPIFY] Scripting related refactoring

+ Move generating hipify-perl and hipify-python into separate namespaces and files
+ Move getAbsoluteFilePath and getAbsoluteDirectoryPath to StringUtils


[ROCm/hip commit: b7df0627b1]
This commit is contained in:
Evgeny Mankov
2019-09-15 21:13:56 +03:00
parent 6bad125069
commit 8e1256aa00
6 changed files with 352 additions and 222 deletions
@@ -34,3 +34,15 @@ llvm::StringRef unquoteStr(llvm::StringRef s);
* If `s` starts with `prefix`, remove it. Otherwise, does nothing.
*/
void removePrefixIfPresent(std::string &s, const std::string& prefix);
/**
* Returns Absolute File Path based on filename, otherwise - error.
*/
std::string getAbsoluteFilePath(const std::string& sFile, std::error_code& EC);
/**
* Returns Absolute Directory Path based on directory name, otherwise - error;
* by default the directory is temporary and created.
*/
std::string getAbsoluteDirectoryPath(const std::string& sDir, std::error_code& EC,
const std::string& sDirType = "temporary", bool bCreateDir = true);