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,h --
clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeSafety.h
clang/include/clang/Analysis/Analyses/LifetimeSafety/LiveOrigins.h
clang/include/clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h
clang/include/clang/Analysis/Analyses/LifetimeSafety/MovedLoans.h
clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h
clang/include/clang/Analysis/Analyses/LiveVariables.h
clang/lib/Analysis/LiveVariables.cpp llvm/benchmarks/ImmutableSetBuildBM.cpp
llvm/benchmarks/ImmutableSetIteratorBM.cpp llvm/include/llvm/ADT/ImmutableMap.h
llvm/include/llvm/ADT/ImmutableSet.h llvm/unittests/ADT/ImmutableSetTest.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/Analysis/Analyses/LifetimeSafety/Utils.h
b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h
index 4cb79a320..7819a9b21 100644
--- a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h
@@ -36,8 +36,7 @@ template <typename Tag> struct ID {
/// Computes the union of two ImmutableSets. Templated on the set type so the
/// element, value-info and canonicalization parameters need not be spelled
out.
-template <typename SetT>
-SetT join(SetT A, SetT B, typename SetT::Factory &F) {
+template <typename SetT> SetT join(SetT A, SetT B, typename SetT::Factory &F) {
if (A.getRootWithoutRetain() == B.getRootWithoutRetain())
return A;
if (A.getHeight() < B.getHeight())
diff --git a/clang/include/clang/Analysis/Analyses/LiveVariables.h
b/clang/include/clang/Analysis/Analyses/LiveVariables.h
index d62dc8c73..39d754521 100644
--- a/clang/include/clang/Analysis/Analyses/LiveVariables.h
+++ b/clang/include/clang/Analysis/Analyses/LiveVariables.h
@@ -34,7 +34,6 @@ public:
class LivenessValues {
public:
-
SetTy<const Expr *> liveExprs;
SetTy<const VarDecl *> liveDecls;
SetTy<const BindingDecl *> liveBindings;
diff --git a/clang/lib/Analysis/LiveVariables.cpp
b/clang/lib/Analysis/LiveVariables.cpp
index 6ffd99d68..af2f5a876 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -107,18 +107,20 @@ LiveVariables::LivenessValues
LiveVariablesImpl::merge(LiveVariables::LivenessValues valsA,
LiveVariables::LivenessValues valsB) {
- SetRefTy<const Expr *> SSetRefA(
- valsA.liveExprs.getRootWithoutRetain(), ESetFact.getTreeFactory()),
+ SetRefTy<const Expr *> SSetRefA(valsA.liveExprs.getRootWithoutRetain(),
+ ESetFact.getTreeFactory()),
SSetRefB(valsB.liveExprs.getRootWithoutRetain(),
ESetFact.getTreeFactory());
- SetRefTy<const VarDecl *>
- DSetRefA(valsA.liveDecls.getRootWithoutRetain(),
DSetFact.getTreeFactory()),
- DSetRefB(valsB.liveDecls.getRootWithoutRetain(),
DSetFact.getTreeFactory());
+ SetRefTy<const VarDecl *> DSetRefA(valsA.liveDecls.getRootWithoutRetain(),
+ DSetFact.getTreeFactory()),
+ DSetRefB(valsB.liveDecls.getRootWithoutRetain(),
+ DSetFact.getTreeFactory());
- SetRefTy<const BindingDecl *>
- BSetRefA(valsA.liveBindings.getRootWithoutRetain(),
BSetFact.getTreeFactory()),
- BSetRefB(valsB.liveBindings.getRootWithoutRetain(),
BSetFact.getTreeFactory());
+ SetRefTy<const BindingDecl *> BSetRefA(
+ valsA.liveBindings.getRootWithoutRetain(), BSetFact.getTreeFactory()),
+ BSetRefB(valsB.liveBindings.getRootWithoutRetain(),
+ BSetFact.getTreeFactory());
SSetRefA = mergeSets(SSetRefA, SSetRefB);
DSetRefA = mergeSets(DSetRefA, DSetRefB);
@@ -223,9 +225,10 @@ static void AddLiveExpr(LiveVariables::SetTy<const Expr *>
&Set,
/// "(a < b) || (c && d && ((e || f) != (g && h)))"
/// the following expressions will be added as live:
/// "a < b", "c", "d", "((e || f) != (g && h))"
-static void AddAllConditionalTerms(LiveVariables::SetTy<const Expr *> &Set,
- LiveVariables::SetTy<const Expr *>::Factory
&F,
- const Expr *Cond) {
+static void
+AddAllConditionalTerms(LiveVariables::SetTy<const Expr *> &Set,
+ LiveVariables::SetTy<const Expr *>::Factory &F,
+ const Expr *Cond) {
AddLiveExpr(Set, F, Cond);
if (auto const *BO = dyn_cast<BinaryOperator>(Cond->IgnoreParens());
BO && BO->isLogicalOp()) {
diff --git a/llvm/include/llvm/ADT/ImmutableMap.h
b/llvm/include/llvm/ADT/ImmutableMap.h
index 89ac42be2..6362d25cc 100644
--- a/llvm/include/llvm/ADT/ImmutableMap.h
+++ b/llvm/include/llvm/ADT/ImmutableMap.h
@@ -59,7 +59,7 @@ struct ImutKeyValueInfo {
};
template <typename KeyT, typename ValT,
- typename ValInfo = ImutKeyValueInfo<KeyT,ValT>,
+ typename ValInfo = ImutKeyValueInfo<KeyT, ValT>,
bool Canonicalize = true>
class ImmutableMap {
public:
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h
b/llvm/include/llvm/ADT/ImmutableSet.h
index 1c646e81d..545bd21ff 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/include/llvm/ADT/ImmutableSet.h
@@ -45,10 +45,11 @@ class ImutAVLTreeInOrderIterator;
namespace ImutAVLDetail {
/// The intrusive doubly-linked chain of same-digest trees in the factory's
-/// canonicalization cache. Held as an (empty) base so that, when
canonicalization
-/// is disabled, the empty base optimization removes it entirely. Kept separate
-/// from the cached digest below so that the two pointers pack without the tail
-/// padding that grouping a trailing 32-bit field with them would introduce.
+/// canonicalization cache. Held as an (empty) base so that, when
+/// canonicalization is disabled, the empty base optimization removes it
+/// entirely. Kept separate from the cached digest below so that the two
+/// pointers pack without the tail padding that grouping a trailing 32-bit
field
+/// with them would introduce.
template <typename Tree, bool Canonicalize> struct CanonicalLinks {
Tree *Prev = nullptr;
Tree *Next = nullptr;
@@ -56,8 +57,8 @@ template <typename Tree, bool Canonicalize> struct
CanonicalLinks {
template <typename Tree> struct CanonicalLinks<Tree, false> {};
/// The cached structural digest, used only for canonicalization. Stored as an
-/// LLVM_NO_UNIQUE_ADDRESS member so it occupies no space when disabled and
packs
-/// alongside the adjacent 32-bit fields when enabled.
+/// LLVM_NO_UNIQUE_ADDRESS member so it occupies no space when disabled and
+/// packs alongside the adjacent 32-bit fields when enabled.
template <bool Canonicalize> struct CanonicalDigest {
uint32_t Digest = 0;
};
@@ -73,8 +74,8 @@ template <typename Tree> struct CanonicalCache<Tree, false>
{};
template <typename ImutInfo, bool Canonicalize = true>
class ImutAVLTree
- : private ImutAVLDetail::CanonicalLinks<
- ImutAVLTree<ImutInfo, Canonicalize>, Canonicalize> {
+ : private ImutAVLDetail::CanonicalLinks<ImutAVLTree<ImutInfo,
Canonicalize>,
+ Canonicalize> {
public:
using key_type_ref = typename ImutInfo::key_type_ref;
using value_type = typename ImutInfo::value_type;
@@ -267,11 +268,10 @@ private:
private:
/// Internal constructor that is only called by ImutAVLFactory.
- ImutAVLTree(Factory *f, ImutAVLTree* l, ImutAVLTree* r, value_type_ref v,
+ ImutAVLTree(Factory *f, ImutAVLTree *l, ImutAVLTree *r, value_type_ref v,
unsigned height)
- : left(l), right(r), height(height), IsMutable(true),
- IsDigestCached(false), IsCanonicalized(false), value(v), factory(f)
- {
+ : left(l), right(r), height(height), IsMutable(true),
+ IsDigestCached(false), IsCanonicalized(false), value(v), factory(f) {
if (left) left->retain();
if (right) right->retain();
}
@@ -401,8 +401,8 @@ struct IntrusiveRefCntPtrInfo<ImutAVLTree<ImutInfo,
Canonicalize>> {
template <typename ImutInfo, bool Canonicalize>
class ImutAVLFactory
- : private ImutAVLDetail::CanonicalCache<
- ImutAVLTree<ImutInfo, Canonicalize>, Canonicalize> {
+ : private ImutAVLDetail::CanonicalCache<ImutAVLTree<ImutInfo,
Canonicalize>,
+ Canonicalize> {
friend class ImutAVLTree<ImutInfo, Canonicalize>;
using TreeTy = ImutAVLTree<ImutInfo, Canonicalize>;
@@ -661,7 +661,7 @@ public:
unsigned digest = TNew->computeDigest();
TreeTy *&entry = this->Cache[maskCacheIndex(digest)];
if (entry) {
- for (TreeTy *T = entry ; T != nullptr; T = T->Next) {
+ for (TreeTy *T = entry; T != nullptr; T = T->Next) {
// Compare the contents of 'T' with 'TNew'. isEqual skips subtrees that
// are shared by pointer, so for structurally-shared persistent trees
// (the common case, e.g. one derived from the other) this is linear in
@@ -971,8 +971,7 @@ public:
public:
Factory() = default;
- Factory(BumpPtrAllocator& Alloc)
- : F(Alloc) {}
+ Factory(BumpPtrAllocator &Alloc) : F(Alloc) {}
Factory(const Factory& RHS) = delete;
void operator=(const Factory& RHS) = delete;
diff --git a/llvm/unittests/ADT/ImmutableSetTest.cpp
b/llvm/unittests/ADT/ImmutableSetTest.cpp
index 3fa8410e2..c3ad1783b 100644
--- a/llvm/unittests/ADT/ImmutableSetTest.cpp
+++ b/llvm/unittests/ADT/ImmutableSetTest.cpp
@@ -223,7 +223,7 @@ using TreeIter = Tree::iterator; //
ImutAVLTreeInOrderIterator
// Build an ImmutableSet from the given values (in the given insertion order),
// optionally removing some afterwards, so trees of varied shape are produced.
NCSet<int> buildSet(NCSet<int>::Factory &F, ArrayRef<int> ToAdd,
- ArrayRef<int> ToRemove = {}) {
+ ArrayRef<int> ToRemove = {}) {
NCSet<int> S = F.getEmptySet();
for (int V : ToAdd)
S = F.add(S, V);
``````````
</details>
https://github.com/llvm/llvm-project/pull/209300
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits