[clang] [DRAFT][analyzer][NFC] clang-format our folders (PR #82599)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 22 01:59:26 PST 2024
================
@@ -441,48 +419,79 @@ class PrettyPrinter {
// Return the precedence of a given node, for use in pretty printing.
unsigned precedence(const SExpr *E) {
switch (E->opcode()) {
- case COP_Future: return Prec_Atom;
- case COP_Undefined: return Prec_Atom;
- case COP_Wildcard: return Prec_Atom;
-
- case COP_Literal: return Prec_Atom;
- case COP_LiteralPtr: return Prec_Atom;
- case COP_Variable: return Prec_Atom;
- case COP_Function: return Prec_Decl;
- case COP_SFunction: return Prec_Decl;
- case COP_Code: return Prec_Decl;
- case COP_Field: return Prec_Decl;
-
- case COP_Apply: return Prec_Postfix;
- case COP_SApply: return Prec_Postfix;
- case COP_Project: return Prec_Postfix;
-
- case COP_Call: return Prec_Postfix;
- case COP_Alloc: return Prec_Other;
- case COP_Load: return Prec_Postfix;
- case COP_Store: return Prec_Other;
- case COP_ArrayIndex: return Prec_Postfix;
- case COP_ArrayAdd: return Prec_Postfix;
-
- case COP_UnaryOp: return Prec_Unary;
- case COP_BinaryOp: return Prec_Binary;
- case COP_Cast: return Prec_Atom;
-
- case COP_SCFG: return Prec_Decl;
- case COP_BasicBlock: return Prec_MAX;
- case COP_Phi: return Prec_Atom;
- case COP_Goto: return Prec_Atom;
- case COP_Branch: return Prec_Atom;
- case COP_Return: return Prec_Other;
-
- case COP_Identifier: return Prec_Atom;
- case COP_IfThenElse: return Prec_Other;
- case COP_Let: return Prec_Decl;
+ case COP_Future:
+ return Prec_Atom;
+ case COP_Undefined:
+ return Prec_Atom;
+ case COP_Wildcard:
+ return Prec_Atom;
+
+ case COP_Literal:
+ return Prec_Atom;
+ case COP_LiteralPtr:
+ return Prec_Atom;
+ case COP_Variable:
+ return Prec_Atom;
+ case COP_Function:
+ return Prec_Decl;
+ case COP_SFunction:
+ return Prec_Decl;
+ case COP_Code:
+ return Prec_Decl;
+ case COP_Field:
+ return Prec_Decl;
+
+ case COP_Apply:
+ return Prec_Postfix;
+ case COP_SApply:
+ return Prec_Postfix;
+ case COP_Project:
+ return Prec_Postfix;
+
+ case COP_Call:
+ return Prec_Postfix;
+ case COP_Alloc:
+ return Prec_Other;
+ case COP_Load:
+ return Prec_Postfix;
+ case COP_Store:
+ return Prec_Other;
+ case COP_ArrayIndex:
+ return Prec_Postfix;
+ case COP_ArrayAdd:
+ return Prec_Postfix;
+
+ case COP_UnaryOp:
+ return Prec_Unary;
+ case COP_BinaryOp:
+ return Prec_Binary;
+ case COP_Cast:
+ return Prec_Atom;
+
+ case COP_SCFG:
+ return Prec_Decl;
+ case COP_BasicBlock:
+ return Prec_MAX;
+ case COP_Phi:
+ return Prec_Atom;
+ case COP_Goto:
+ return Prec_Atom;
+ case COP_Branch:
+ return Prec_Atom;
+ case COP_Return:
+ return Prec_Other;
+
+ case COP_Identifier:
+ return Prec_Atom;
+ case COP_IfThenElse:
+ return Prec_Other;
+ case COP_Let:
+ return Prec_Decl;
----------------
steakhal wrote:
```suggestion
// clang-format off
case COP_Future: return Prec_Atom;
case COP_Undefined: return Prec_Atom;
case COP_Wildcard: return Prec_Atom;
case COP_Literal: return Prec_Atom;
case COP_LiteralPtr: return Prec_Atom;
case COP_Variable: return Prec_Atom;
case COP_Function: return Prec_Decl;
case COP_SFunction: return Prec_Decl;
case COP_Code: return Prec_Decl;
case COP_Field: return Prec_Decl;
case COP_Apply: return Prec_Postfix;
case COP_SApply: return Prec_Postfix;
case COP_Project: return Prec_Postfix;
case COP_Call: return Prec_Postfix;
case COP_Alloc: return Prec_Other;
case COP_Load: return Prec_Postfix;
case COP_Store: return Prec_Other;
case COP_ArrayIndex: return Prec_Postfix;
case COP_ArrayAdd: return Prec_Postfix;
case COP_UnaryOp: return Prec_Unary;
case COP_BinaryOp: return Prec_Binary;
case COP_Cast: return Prec_Atom;
case COP_SCFG: return Prec_Decl;
case COP_BasicBlock: return Prec_MAX;
case COP_Phi: return Prec_Atom;
case COP_Goto: return Prec_Atom;
case COP_Branch: return Prec_Atom;
case COP_Return: return Prec_Other;
case COP_Identifier: return Prec_Atom;
case COP_IfThenElse: return Prec_Other;
case COP_Let: return Prec_Decl;
// clang-format on
```
https://github.com/llvm/llvm-project/pull/82599
More information about the cfe-commits
mailing list