Create Strings.cpp and move string manipulation functions to that file.

llvm-svn: 274109
This commit is contained in:
Rui Ueyama
2016-06-29 08:01:32 +00:00
parent 518cbc7cc3
commit 93c9af425e
10 changed files with 85 additions and 60 deletions

View File

@@ -161,18 +161,3 @@ size_t ScriptParserBase::getPos() {
const char *Tok = Tokens[Pos - 1].data();
return StringRef(Begin, Tok - Begin).count('\n') + 1;
}
std::vector<uint8_t> ScriptParserBase::parseHex(StringRef S) {
std::vector<uint8_t> Hex;
while (!S.empty()) {
StringRef B = S.substr(0, 2);
S = S.substr(2);
uint8_t H;
if (B.getAsInteger(16, H)) {
setError("not a hexadecimal value: " + B);
return {};
}
Hex.push_back(H);
}
return Hex;
}