[HIPIFY] Code cleanup and formatting

This commit is contained in:
Evgeny Mankov
2018-10-15 15:27:37 +03:00
parent 4ab45ef878
commit ee3a5cc722
12 changed files with 684 additions and 843 deletions
+8 -10
View File
@@ -1,17 +1,15 @@
#include "StringUtils.h"
llvm::StringRef unquoteStr(llvm::StringRef s) {
if (s.size() > 1 && s.front() == '"' && s.back() == '"') {
return s.substr(1, s.size() - 2);
}
return s;
if (s.size() > 1 && s.front() == '"' && s.back() == '"') {
return s.substr(1, s.size() - 2);
}
return s;
}
void removePrefixIfPresent(std::string &s, std::string prefix) {
if (s.find(prefix) != 0) {
return;
}
s.erase(0, prefix.size());
if (s.find(prefix) != 0) {
return;
}
s.erase(0, prefix.size());
}