Skip to content

[TableGen] Add declarations to silence gcc warning. NFC #125892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Feb 5, 2025

Add declarations of SDTypeConstraint's operator== and operator< to the llvm namespace. These are declared as friends inside the class which makes them part of the enclosing namespace, but gcc wants it to be more explicit.

Fixes #125537.

Add declarations of SDTypeConstraint's operator== and operator< to
the llvm namespace. These are declared as friends inside the class which
makes them part of the enclosing namespace, but gcc wants it to be more
explicit.

Fixes llvm#125537.
@llvmbot
Copy link
Member

llvmbot commented Feb 5, 2025

@llvm/pr-subscribers-tablegen

Author: Craig Topper (topperc)

Changes

Add declarations of SDTypeConstraint's operator== and operator< to the llvm namespace. These are declared as friends inside the class which makes them part of the enclosing namespace, but gcc wants it to be more explicit.

Fixes #125537.


Full diff: https://github.com/llvm/llvm-project/pull/125892.diff

1 Files Affected:

  • (modified) llvm/utils/TableGen/Common/CodeGenDAGPatterns.h (+3)
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
index 6a6f1a6ac437cc..328700cd0d163a 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
@@ -393,6 +393,9 @@ struct SDTypeConstraint {
                         const SDTypeConstraint &RHS);
 };
 
+bool operator==(const SDTypeConstraint &LHS, const SDTypeConstraint &RHS);
+bool operator<(const SDTypeConstraint &LHS, const SDTypeConstraint &RHS);
+
 /// ScopedName - A name of a node associated with a "scope" that indicates
 /// the context (e.g. instance of Pattern or PatFrag) in which the name was
 /// used. This enables substitution of pattern fragments while keeping track

Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@topperc topperc merged commit 25dd93a into llvm:main Feb 5, 2025
8 of 9 checks passed
@topperc topperc deleted the pr/warning branch February 5, 2025 19:22
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
Add declarations of SDTypeConstraint's operator== and operator< to the
llvm namespace. These are declared as friends inside the class which
makes them part of the enclosing namespace, but gcc wants it to be more
explicit.

Fixes llvm#125537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warnings building llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
3 participants