[clang] [llvm] [NFC][SetTheory] Refactor to use const pointers and range loops (PR #105544)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 09:09:14 PDT 2024
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 6816a137985bfa38cda20b9cd4e23c361c3bd0de b9b2cea49dab03ad2f01b70ffa784be8a5e23b6d --extensions h,cpp -- clang/utils/TableGen/NeonEmitter.cpp llvm/include/llvm/TableGen/SetTheory.h llvm/lib/TableGen/SetTheory.cpp llvm/utils/TableGen/Common/CodeGenRegisters.cpp llvm/utils/TableGen/Common/CodeGenSchedule.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp
index 6859fdf9b6..8ec8e67388 100644
--- a/clang/utils/TableGen/NeonEmitter.cpp
+++ b/clang/utils/TableGen/NeonEmitter.cpp
@@ -1618,7 +1618,8 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
public:
MaskExpander(unsigned N) : N(N) {}
- void expand(SetTheory &ST, const Record *R, SetTheory::RecSet &Elts) override {
+ void expand(SetTheory &ST, const Record *R,
+ SetTheory::RecSet &Elts) override {
unsigned Addend = 0;
if (R->getName() == "mask0")
Addend = 0;
diff --git a/llvm/include/llvm/TableGen/SetTheory.h b/llvm/include/llvm/TableGen/SetTheory.h
index 894fc6c399..954453b783 100644
--- a/llvm/include/llvm/TableGen/SetTheory.h
+++ b/llvm/include/llvm/TableGen/SetTheory.h
@@ -76,7 +76,7 @@ public:
/// apply - Apply this operator to Expr's arguments and insert the result
/// in Elts.
- virtual void apply(SetTheory&, const DagInit *Expr, RecSet &Elts,
+ virtual void apply(SetTheory &, const DagInit *Expr, RecSet &Elts,
ArrayRef<SMLoc> Loc) = 0;
};
@@ -89,7 +89,7 @@ public:
public:
virtual ~Expander() = default;
- virtual void expand(SetTheory&, const Record*, RecSet &Elts) = 0;
+ virtual void expand(SetTheory &, const Record *, RecSet &Elts) = 0;
};
private:
diff --git a/llvm/lib/TableGen/SetTheory.cpp b/llvm/lib/TableGen/SetTheory.cpp
index 50a35eb86e..edb99827f7 100644
--- a/llvm/lib/TableGen/SetTheory.cpp
+++ b/llvm/lib/TableGen/SetTheory.cpp
@@ -13,9 +13,9 @@
#include "llvm/TableGen/SetTheory.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/SMLoc.h"
@@ -77,8 +77,8 @@ struct AndOp : public SetTheory::Operator {
// SetIntBinOp - Abstract base class for (Op S, N) operators.
struct SetIntBinOp : public SetTheory::Operator {
- virtual void apply2(SetTheory &ST, const DagInit *Expr, RecSet &Set, int64_t N,
- RecSet &Elts, ArrayRef<SMLoc> Loc) = 0;
+ virtual void apply2(SetTheory &ST, const DagInit *Expr, RecSet &Set,
+ int64_t N, RecSet &Elts, ArrayRef<SMLoc> Loc) = 0;
void apply(SetTheory &ST, const DagInit *Expr, RecSet &Elts,
ArrayRef<SMLoc> Loc) override {
@@ -211,7 +211,7 @@ struct SequenceOp : public SetTheory::Operator {
PrintFatalError(Loc, "To out of range");
const RecordKeeper &Records =
- cast<DefInit>(Expr->getOperator())->getDef()->getRecords();
+ cast<DefInit>(Expr->getOperator())->getDef()->getRecords();
Step *= From <= To ? 1 : -1;
while (true) {
diff --git a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
index 61b5c94403..ee58cad358 100644
--- a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
@@ -625,7 +625,8 @@ struct TupleExpander : SetTheory::Expander {
TupleExpander(std::vector<std::unique_ptr<Record>> &SynthDefs)
: SynthDefs(SynthDefs) {}
- void expand(SetTheory &ST, const Record *Def, SetTheory::RecSet &Elts) override {
+ void expand(SetTheory &ST, const Record *Def,
+ SetTheory::RecSet &Elts) override {
std::vector<Record *> Indices = Def->getValueAsListOfDefs("SubRegIndices");
unsigned Dim = Indices.size();
ListInit *SubRegs = Def->getValueAsListInit("SubRegs");
``````````
</details>
https://github.com/llvm/llvm-project/pull/105544
More information about the llvm-commits
mailing list