Skip to content

Commit

Permalink
make fcmpEq plugins follow llvm style guides
Browse files Browse the repository at this point in the history
LLVM style guides states: make anonymous namespaces as small as possible, and only use them for class declarations.
but fcmpEq plugins were using it for functions. Changed to use static instead
  • Loading branch information
qbojj authored and banach-space committed Feb 17, 2024
1 parent cc4e59c commit 04e0fbf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions lib/ConvertFCmpEq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
using namespace llvm;

// Unnamed namespace for private functions
namespace {

FCmpInst *convertFCmpEqInstruction(FCmpInst *FCmp) noexcept {
static FCmpInst *convertFCmpEqInstruction(FCmpInst *FCmp) noexcept {
assert(FCmp && "The given fcmp instruction is null");

if (!FCmp->isEquality()) {
Expand Down Expand Up @@ -115,8 +113,6 @@ FCmpInst *convertFCmpEqInstruction(FCmpInst *FCmp) noexcept {
return FCmp;
}

} // namespace

static constexpr char PassArg[] = "convert-fcmp-eq";
static constexpr char PassName[] =
"Convert floating-point equality comparisons";
Expand Down
5 changes: 0 additions & 5 deletions lib/FindFCmpEq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@

using namespace llvm;

// Unnamed namespace for internal functions
namespace {

static void
printFCmpEqInstructions(raw_ostream &OS, Function &Func,
const FindFCmpEq::Result &FCmpEqInsts) noexcept {
Expand All @@ -68,8 +65,6 @@ printFCmpEqInstructions(raw_ostream &OS, Function &Func,
}
}

} // namespace

static constexpr char PassArg[] = "find-fcmp-eq";
static constexpr char PassName[] =
"Floating-point equality comparisons locator";
Expand Down

0 comments on commit 04e0fbf

Please sign in to comment.