Index: llvm/trunk/lib/ObjectYAML/YAML.cpp =================================================================== --- llvm/trunk/lib/ObjectYAML/YAML.cpp +++ llvm/trunk/lib/ObjectYAML/YAML.cpp @@ -31,7 +31,7 @@ // TODO: Can we improve YAMLIO to permit a more accurate diagnostic here? // (e.g. a caret pointing to the offending character). for (unsigned I = 0, N = Scalar.size(); I != N; ++I) - if (!isxdigit(Scalar[I])) + if (!llvm::isHexDigit(Scalar[I])) return "BinaryRef hex string must contain only hex digits."; Val = yaml::BinaryRef(Scalar); return {}; @@ -43,8 +43,9 @@ return; } for (unsigned I = 0, N = Data.size(); I != N; I += 2) { - uint8_t Byte; - StringRef((const char *)&Data[I], 2).getAsInteger(16, Byte); + uint8_t Byte = llvm::hexDigitValue(Data[I]); + Byte <<= 4; + Byte |= llvm::hexDigitValue(Data[I + 1]); OS.write(Byte); } }