Fix mismatched #endif.
Adopt llvm::hexDigitValue.
Remove unused variable