================
@@ -59,6 +61,21 @@ OptionalAmount
clang::analyze_format_string::ParseAmount(const char *&Beg,
return OptionalAmount();
}
+static bool ParseWidthModifier(const char *&I, const char *E,
+ unsigned &BitWidth, unsigned &ModifierLength) {
+ StringRef W = StringRef(I, E - I).take_while(llvm::isDigit);
+ if (W.empty() || W.front() == '0')
+ return false;
+
+ if (W.getAsInteger(10, BitWidth))
+ BitWidth = std::numeric_limits<unsigned>::max();
+
+ for (const char *End = W.end(); I != End; ++I)
----------------
AaronBallman wrote:
Do we need a loop for this, we should be able to use `W` to calculate it
directly, no?
https://github.com/llvm/llvm-project/pull/199991
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits