================
@@ -1140,6 +1143,152 @@ static bool ProcessFormatStringLiteral(const Expr 
*FormatExpr,
   return false;
 }
 
+static std::optional<int> getPathMaxValue(const ASTContext &Ctx) {
+  if (Ctx.getTargetInfo().getTriple().isOSGlibc())
+    return {4096};
+
+  if (Ctx.getTargetInfo().getTriple().isOSDarwin())
+    return {1024};
+
+  return std::nullopt;
+}
+
+/* Follow simple references to other macros so we can match the Expr spelling 
*/
----------------
ziqingluo-90 wrote:

nit: this function could be useful for other checks so I'd like the comment to 
be a bit more clear:
- We do not have to mention "match the Expr spelling" since it is unrelated to 
this function.
- We could make it clear that this function follows the macro chain, where all 
macros are "simple"---having no arguments and are defined as an identifier of 
another macro.  The function returns the first non-"simple" macro along the 
chain or nullptr if the chain is empty.

https://github.com/llvm/llvm-project/pull/177286
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to