[clang] Use range-based for to iterate over fields in record layout, NFC (PR #122029)

Boaz Brickner via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 00:35:03 PST 2025


================
@@ -3115,7 +3115,19 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
 
   /// Returns the index of this field within its record,
   /// as appropriate for passing to ASTRecordLayout::getFieldOffset.
-  unsigned getFieldIndex() const;
+  unsigned getFieldIndex() const {
+    const FieldDecl *C = getCanonicalDecl();
----------------
bricknerb wrote:

Consider keeping the original Canonical variable name.
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

https://github.com/llvm/llvm-project/pull/122029


More information about the cfe-commits mailing list