-
Notifications
You must be signed in to change notification settings - Fork 13.5k
EquivalenceClasses: Make ECValue public. NFC #139689
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
Conversation
Expose the inner class so that we can explicitly write the type outside the parent class.
@llvm/pr-subscribers-llvm-adt Author: Ruiling, Song (ruiling) ChangesExpose the inner class so that we can explicitly write the type outside the parent class. Full diff: https://github.com/llvm/llvm-project/pull/139689.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index fed012ce56005..b1009f8b49992 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -60,6 +60,7 @@ namespace llvm {
/// 5 1 2
///
template <class ElemTy> class EquivalenceClasses {
+public:
/// ECValue - The EquivalenceClasses data structure is just a set of these.
/// Each of these represents a relation for a value. First it stores the
/// value itself. Next, it provides a "next pointer", which is used to
@@ -122,6 +123,7 @@ template <class ElemTy> class EquivalenceClasses {
}
};
+private:
/// TheMapping - This implicitly provides a mapping from ElemTy values to the
/// ECValues, it just keeps the key as part of the value.
DenseMap<ElemTy, ECValue *> TheMapping;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share why this is needed? ECValue
is intentionally not exposed publicly as it is an internal implementation detail
It's directly referenced in public members so I don't see how it can't be public |
See the discussion at #137784 (comment). Using explicit type |
@fhahn Any further comment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for providing the additional context.
Expose the inner class so that we can explicitly write the type outside the parent class.