Files
rocm-systems/projects/clr/hipamd/hipify-clang/src/StringUtils.cpp
T
Evgeny Mankov 7b244965b6 [HIPIFY][fix] Fix typo and functions' string arguments
+ Fix typo with missing comma in counterNames array
+ Change std::string argument to const std::string& argument in all functions


[ROCm/clr commit: 48abb4a36b]
2018-11-01 16:57:57 +03:00

16 rivejä
340 B
C++

#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;
}
void removePrefixIfPresent(std::string &s, const std::string& prefix) {
if (s.find(prefix) != 0) {
return;
}
s.erase(0, prefix.size());
}