[clang][NFC] Improve locality of recently refactored enums (#70943)
This patch moves definition of recently refactored enums closer to the
types where they were originally defined. Since they are scoped enums at
namespace scope now, they can be forward-declared.
Refactorings in question are:
aaba3761db84032541712899964714f3184e8b3d
50dec541f328a251c2830421f354e4439e635def
b120fe8d3288c4dca1b5427ca34839ce8833f71c
ae7b20b583fab1325d8b51fe5f2eaf612de8b95e
4ad2ada5216ee2bb3c334a3233a9ab51f2521b82
49fd28d9601dde429436655ec74234e895c60b89
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 1c2158f..d9b00b1 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -4059,6 +4059,29 @@
static bool classofKind(Kind K) { return K == Enum; }
};
+/// Enum that represents the different ways arguments are passed to and
+/// returned from function calls. This takes into account the target-specific
+/// and version-specific rules along with the rules determined by the
+/// language.
+enum class ArgPassingKind {
+ /// The argument of this type can be passed directly in registers.
+ CanPassInRegs,
+
+ /// The argument of this type cannot be passed directly in registers.
+ /// Records containing this type as a subobject are not forced to be passed
+ /// indirectly. This value is used only in C++. This value is required by
+ /// C++ because, in uncommon situations, it is possible for a class to have
+ /// only trivial copy/move constructors even when one of its subobjects has
+ /// a non-trivial copy/move constructor (if e.g. the corresponding copy/move
+ /// constructor in the derived class is deleted).
+ CannotPassInRegs,
+
+ /// The argument of this type cannot be passed directly in registers.
+ /// Records containing this type as a subobject are forced to be passed
+ /// indirectly.
+ CanNeverPassInRegs
+};
+
/// Represents a struct/union/class. For example:
/// struct X; // Forward declaration, no "body".
/// union Y { int A, B; }; // Has body with members A and B (FieldDecls).