[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 07:01:50 PST 2025
================
@@ -127,6 +127,33 @@ class AccessSpecDecl : public Decl {
static bool classofKind(Kind K) { return K == AccessSpec; }
};
+enum class RelocatableOrReplaceableClassSpecifierKind {
+ Relocatable,
+ Replaceable
+};
+
+template <RelocatableOrReplaceableClassSpecifierKind MK>
+class BasicRelocatableOrReplaceableClassSpecifier {
+public:
+ BasicRelocatableOrReplaceableClassSpecifier() = default;
+ BasicRelocatableOrReplaceableClassSpecifier(SourceLocation Begin)
+ : Loc(Begin) {}
+ void Set(SourceLocation Begin) { Loc = Begin; }
+
+ bool isSet() const { return !Loc.isInvalid(); }
+
+ SourceLocation getLocation() const { return Loc; }
+
+private:
+ SourceLocation Loc;
----------------
erichkeane wrote:
Is there intent for this to 'have' more to it? At the moment, this seems like it has weak justification over a `SourceLocation`.
https://github.com/llvm/llvm-project/pull/127636
More information about the cfe-commits
mailing list