[clang] 2fd7550 - [clang] NFC: add line break at the end of if expressions
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 30 04:49:24 PDT 2021
Author: Zhouyi Zhou
Date: 2021-06-30T19:48:24+08:00
New Revision: 2fd75507d1855300d0a59451337d0a55b081887c
URL: https://github.com/llvm/llvm-project/commit/2fd75507d1855300d0a59451337d0a55b081887c
DIFF: https://github.com/llvm/llvm-project/commit/2fd75507d1855300d0a59451337d0a55b081887c.diff
LOG: [clang] NFC: add line break at the end of if expressions
Hi,
In function TransformTemplateArgument,
would it be better to add line break at the end of "if" expressions?
I use clang-format to do the job for me.
Thanks a lot
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D104604
Added:
Modified:
clang/lib/Sema/TreeTransform.h
Removed:
################################################################################
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 7b9f6a85260f..70ba631dbfc6 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -4322,10 +4322,10 @@ void TreeTransform<Derived>::InventTemplateArgumentLoc(
Arg, QualType(), getDerived().getBaseLocation());
}
-template<typename Derived>
+template <typename Derived>
bool TreeTransform<Derived>::TransformTemplateArgument(
- const TemplateArgumentLoc &Input,
- TemplateArgumentLoc &Output, bool Uneval) {
+ const TemplateArgumentLoc &Input, TemplateArgumentLoc &Output,
+ bool Uneval) {
const TemplateArgument &Arg = Input.getArgument();
switch (Arg.getKind()) {
case TemplateArgument::Null:
@@ -4374,7 +4374,8 @@ bool TreeTransform<Derived>::TransformTemplateArgument(
DI = InventTypeSourceInfo(Input.getArgument().getAsType());
DI = getDerived().TransformType(DI);
- if (!DI) return true;
+ if (!DI)
+ return true;
Output = TemplateArgumentLoc(TemplateArgument(DI->getType()), DI);
return false;
@@ -4390,9 +4391,8 @@ bool TreeTransform<Derived>::TransformTemplateArgument(
CXXScopeSpec SS;
SS.Adopt(QualifierLoc);
- TemplateName Template
- = getDerived().TransformTemplateName(SS, Arg.getAsTemplate(),
- Input.getTemplateNameLoc());
+ TemplateName Template = getDerived().TransformTemplateName(
+ SS, Arg.getAsTemplate(), Input.getTemplateNameLoc());
if (Template.isNull())
return true;
@@ -4414,11 +4414,13 @@ bool TreeTransform<Derived>::TransformTemplateArgument(
Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
Expr *InputExpr = Input.getSourceExpression();
- if (!InputExpr) InputExpr = Input.getArgument().getAsExpr();
+ if (!InputExpr)
+ InputExpr = Input.getArgument().getAsExpr();
ExprResult E = getDerived().TransformExpr(InputExpr);
E = SemaRef.ActOnConstantExpression(E);
- if (E.isInvalid()) return true;
+ if (E.isInvalid())
+ return true;
Output = TemplateArgumentLoc(TemplateArgument(E.get()), E.get());
return false;
}
More information about the cfe-commits
mailing list