=?utf-8?q?Félix?= Cloutier <[email protected]>,
=?utf-8?q?Félix?= Cloutier <[email protected]>,
=?utf-8?q?Félix?= Cloutier <[email protected]>,
=?utf-8?q?Félix?= Cloutier <[email protected]>,
=?utf-8?q?Félix?= Cloutier <[email protected]>,
=?utf-8?q?Félix?= Cloutier <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c,h --
clang/test/CodeGen/strict-bool.c clang/test/Driver/strict-bool.c
clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGObjC.cpp clang/lib/Driver/ToolChains/Clang.cpp
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.h
b/clang/include/clang/Basic/CodeGenOptions.h
index 3dab0f958..c529e5391 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -672,9 +672,7 @@ public:
}
/// Are we building at -O1 or higher?
- bool isOptimizedBuild() const {
- return OptimizationLevel > 0;
- }
+ bool isOptimizedBuild() const { return OptimizationLevel > 0; }
/// When loading a bool from a storage unit larger than i1, should it
/// be converted to i1 by comparing to 0 or by truncating to i1?
@@ -683,7 +681,7 @@ public:
case BoolFromMem::Strict:
case BoolFromMem::Truncate:
return false;
-
+
case BoolFromMem::NonZero:
return true;
}
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 27c41a8c6..4d8c6ded5 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2576,8 +2576,10 @@ RValue
CodeGenFunction::EmitLoadOfExtVectorElementLValue(LValue LV) {
llvm::Type *LVTy = ConvertType(LV.getType());
if (Element->getType()->getPrimitiveSizeInBits() >
LVTy->getPrimitiveSizeInBits()) {
- if (LV.getType()->hasBooleanRepresentation() &&
CGM.getCodeGenOpts().isConvertingBoolWithCmp0())
- Element = Builder.CreateICmpNE(Element,
llvm::Constant::getNullValue(Element->getType()));
+ if (LV.getType()->hasBooleanRepresentation() &&
+ CGM.getCodeGenOpts().isConvertingBoolWithCmp0())
+ Element = Builder.CreateICmpNE(
+ Element, llvm::Constant::getNullValue(Element->getType()));
else
Element = Builder.CreateTrunc(Element, LVTy);
}
@@ -2596,7 +2598,8 @@ RValue
CodeGenFunction::EmitLoadOfExtVectorElementLValue(LValue LV) {
if (LV.getType()->isExtVectorBoolType()) {
if (CGM.getCodeGenOpts().isConvertingBoolWithCmp0())
- Vec = Builder.CreateICmpNE(Vec,
llvm::Constant::getNullValue(Vec->getType()));
+ Vec = Builder.CreateICmpNE(Vec,
+ llvm::Constant::getNullValue(Vec->getType()));
else
Vec = Builder.CreateTrunc(Vec, ConvertType(LV.getType()), "truncv");
}
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index a6decad4a..53df04f58 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -1209,8 +1209,10 @@ CodeGenFunction::generateObjCGetterBody(const
ObjCImplementationDecl *classImpl,
uint64_t retTySize = CGM.getDataLayout().getTypeSizeInBits(retTy);
if (ivarSize > retTySize) {
bitcastType = llvm::Type::getIntNTy(getLLVMContext(), retTySize);
- if (getterMethod->getReturnType()->hasBooleanRepresentation() &&
CGM.getCodeGenOpts().isConvertingBoolWithCmp0())
- ivarVal = Builder.CreateICmpNE(ivarVal,
llvm::Constant::getNullValue(ivarVal->getType()));
+ if (getterMethod->getReturnType()->hasBooleanRepresentation() &&
+ CGM.getCodeGenOpts().isConvertingBoolWithCmp0())
+ ivarVal = Builder.CreateICmpNE(
+ ivarVal, llvm::Constant::getNullValue(ivarVal->getType()));
else
ivarVal = Builder.CreateTrunc(ivarVal, bitcastType);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/160790
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits