mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 23:45:25 +08:00
Create Strings.cpp and move string manipulation functions to that file.
llvm-svn: 274109
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user