[PATCH] D81667: [FileCheck] Add precision to format specifier
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 02:39:16 PDT 2020
grimar accepted this revision.
grimar added a comment.
Herald added a subscriber: danielkiss.
I've debugged this and its LGTM.
Have a few minor suggestions about the code (up to you).
================
Comment at: llvm/lib/Support/FileCheck.cpp:48
+ auto CreatePrecisionRegex = [this](StringRef S) {
+ return (S + Twine(Precision) + "}").str();
+ };
----------------
Perhaps, a bit cleaner would be to add the "{" right here.
================
Comment at: llvm/lib/Support/FileCheck.cpp:86
+ else
+ AbsoluteValue = cantFail(IntegerValue.getSignedValue());
+ } else {
----------------
You can just use the value you have already.
================
Comment at: llvm/lib/Support/FileCheck.cpp:105
+ AbsoluteValueStr = utohexstr(AbsoluteValue, /*LowerCase=*/true);
+ break;
default:
----------------
You can combine these cases I think:
```
case Kind::HexUpper:
case Kind::HexLower:
AbsoluteValueStr = utohexstr(AbsoluteValue, Value == Kind::HexLower);
break;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81667/new/
https://reviews.llvm.org/D81667
More information about the llvm-commits
mailing list