[PATCH] D97845: [FileCheck] Add support for hex alternate form in FileCheck
Joel E. Denny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 6 04:37:51 PST 2021
jdenny added inline comments.
================
Comment at: llvm/lib/FileCheck/FileCheck.cpp:118
unsigned LeadingZeros = Precision - AbsoluteValueStr.size();
- return (Twine(SignPrefix) + std::string(LeadingZeros, '0') +
- AbsoluteValueStr)
+ return (Twine(AlternateFormPrefix) + Twine(SignPrefix) +
+ std::string(LeadingZeros, '0') + AbsoluteValueStr)
----------------
AlternateFormPrefix and SignPrefix are reversed relative to the version without leading zeroes below. Can it actually matter for hex? Regardless, it should probably be consistent.
================
Comment at: llvm/lib/FileCheck/FileCheckImpl.h:57
unsigned Precision = 0;
+ bool AlternateForm = false;
----------------
Can we have a more exact name than `AlternateForm`? Maybe `HexPrefix`. If generality is better, then maybe `TypePrefix`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97845/new/
https://reviews.llvm.org/D97845
More information about the llvm-commits
mailing list