Skip to content

[clang] Avoid re-evaluating field bitwidth #117732

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
Jan 8, 2025
Merged

Conversation

tbaederr
Copy link
Contributor

@tbaederr tbaederr commented Nov 26, 2024

Save the bitwidth value as a ConstantExpr with the value set. Remove the ASTContext parameter from getBitWidthValue(), so the latter simply returns the value from the ConstantExpr instead of constant-evaluating the bitwidth expression every time it is called.

@tbaederr tbaederr requested a review from Endilll as a code owner November 26, 2024 16:10
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:codegen IR generation bugs: mangling, exceptions, etc. HLSL HLSL Language Support clang:openmp OpenMP related changes to Clang labels Nov 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2024

@llvm/pr-subscribers-clang-modules
@llvm/pr-subscribers-clang-tidy
@llvm/pr-subscribers-clang-tools-extra
@llvm/pr-subscribers-clangd
@llvm/pr-subscribers-backend-risc-v
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-hlsl

@llvm/pr-subscribers-clang-codegen

Author: Timm Baeder (tbaederr)

Changes

Patch is 35.40 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/117732.diff

15 Files Affected:

  • (modified) clang/include/clang/AST/Decl.h (+22-4)
  • (modified) clang/include/clang/AST/DeclObjC.h (+27-7)
  • (modified) clang/include/clang/Sema/Sema.h (+1-1)
  • (modified) clang/lib/AST/ASTContext.cpp (+30-53)
  • (modified) clang/lib/AST/ASTImporter.cpp (+1-1)
  • (modified) clang/lib/AST/Decl.cpp (+18-5)
  • (modified) clang/lib/AST/DeclObjC.cpp (+22-12)
  • (modified) clang/lib/CodeGen/CGObjCMac.cpp (+7-7)
  • (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (+2-1)
  • (modified) clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp (+3-3)
  • (modified) clang/lib/CodeGen/CodeGenModule.cpp (+4-8)
  • (modified) clang/lib/Sema/HLSLExternalSemaSource.cpp (+3-3)
  • (modified) clang/lib/Sema/SemaDecl.cpp (+36-35)
  • (modified) clang/lib/Sema/SemaDeclObjC.cpp (+13-10)
  • (modified) clang/lib/Sema/SemaLambda.cpp (+1-1)
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 8c39ef3d5a9fa6..db3c86a09bfb49 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3089,17 +3089,27 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
     // Active member if ISK is ISK_CapturedVLAType.
     const VariableArrayType *CapturedVLAType;
   };
+  unsigned BitWidthValue = 0;
 
 protected:
   FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
             SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
-            TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
-            InClassInitStyle InitStyle)
+            TypeSourceInfo *TInfo, bool Mutable, InClassInitStyle InitStyle)
+      : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc), BitField(false),
+        Mutable(Mutable), StorageKind((InitStorageKind)InitStyle),
+        CachedFieldIndex(0), Init() {}
+
+  FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
+            SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
+            TypeSourceInfo *TInfo, Expr *BW, unsigned BitWidthValue,
+            bool Mutable, InClassInitStyle InitStyle)
       : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc), BitField(false),
         Mutable(Mutable), StorageKind((InitStorageKind)InitStyle),
         CachedFieldIndex(0), Init() {
-    if (BW)
+    if (BW) {
       setBitWidth(BW);
+      this->BitWidthValue = BitWidthValue;
+    }
   }
 
 public:
@@ -3109,7 +3119,15 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
   static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
                            SourceLocation StartLoc, SourceLocation IdLoc,
                            const IdentifierInfo *Id, QualType T,
-                           TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+                           TypeSourceInfo *TInfo, Expr *BW,
+                           unsigned BitWidthValue, bool Mutable,
+                           InClassInitStyle InitStyle);
+
+  /// For non-bit-fields.
+  static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
+                           SourceLocation StartLoc, SourceLocation IdLoc,
+                           const IdentifierInfo *Id, QualType T,
+                           TypeSourceInfo *TInfo, bool Mutable,
                            InClassInitStyle InitStyle);
 
   static FieldDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 4663603f797545..17bccfda784fed 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -1960,8 +1960,15 @@ class ObjCIvarDecl : public FieldDecl {
   ObjCIvarDecl(ObjCContainerDecl *DC, SourceLocation StartLoc,
                SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
                TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
-               bool synthesized)
-      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
+               unsigned BWValue, bool synthesized)
+      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW, BWValue,
+                  /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
+        DeclAccess(ac), Synthesized(synthesized) {}
+
+  ObjCIvarDecl(ObjCContainerDecl *DC, SourceLocation StartLoc,
+               SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
+               TypeSourceInfo *TInfo, AccessControl ac, bool synthesized)
+      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo,
                   /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
         DeclAccess(ac), Synthesized(synthesized) {}
 
@@ -1970,7 +1977,8 @@ class ObjCIvarDecl : public FieldDecl {
                               SourceLocation StartLoc, SourceLocation IdLoc,
                               const IdentifierInfo *Id, QualType T,
                               TypeSourceInfo *TInfo, AccessControl ac,
-                              Expr *BW = nullptr, bool synthesized = false);
+                              Expr *BW = nullptr, unsigned BWValue = 0,
+                              bool synthesized = false);
 
   static ObjCIvarDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
 
@@ -2028,11 +2036,19 @@ class ObjCIvarDecl : public FieldDecl {
 /// Represents a field declaration created by an \@defs(...).
 class ObjCAtDefsFieldDecl : public FieldDecl {
   ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc,
-                      SourceLocation IdLoc, IdentifierInfo *Id,
-                      QualType T, Expr *BW)
+                      SourceLocation IdLoc, IdentifierInfo *Id, QualType T,
+                      Expr *BW, unsigned BWValue)
+      : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
+                  /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
+                  BW, BWValue, /*Mutable=*/false,
+                  /*HasInit=*/ICIS_NoInit) {}
+
+  ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc,
+                      SourceLocation IdLoc, IdentifierInfo *Id, QualType T)
       : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
                   /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
-                  BW, /*Mutable=*/false, /*HasInit=*/ICIS_NoInit) {}
+                  /*Mutable=*/false,
+                  /*HasInit=*/ICIS_NoInit) {}
 
   void anchor() override;
 
@@ -2040,7 +2056,11 @@ class ObjCAtDefsFieldDecl : public FieldDecl {
   static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC,
                                      SourceLocation StartLoc,
                                      SourceLocation IdLoc, IdentifierInfo *Id,
-                                     QualType T, Expr *BW);
+                                     QualType T, Expr *BW, unsigned BWValue);
+  static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC,
+                                     SourceLocation StartLoc,
+                                     SourceLocation IdLoc, IdentifierInfo *Id,
+                                     QualType T);
 
   static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C,
                                                  GlobalDeclID ID);
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 24abd5d95dd844..5c82a75f491e37 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -4277,7 +4277,7 @@ class Sema final : public SemaBase {
   /// Returns false on success.
   ExprResult VerifyBitField(SourceLocation FieldLoc,
                             const IdentifierInfo *FieldName, QualType FieldTy,
-                            bool IsMsStruct, Expr *BitWidth);
+                            bool IsMsStruct, Expr *BitWidth, unsigned &BWV);
 
   /// IsValueInFlagEnum - Determine if a value is allowed as part of a flag
   /// enum. If AllowMask is true, then we also allow the complement of a valid
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 80e8c5b9df58e7..26631f9a5c7f9b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -7969,11 +7969,10 @@ TypedefDecl *ASTContext::getCFConstantStringDecl() const {
 
   // Create fields
   for (unsigned i = 0; i < Count; ++i) {
-    FieldDecl *Field =
-        FieldDecl::Create(*this, CFConstantStringTagDecl, SourceLocation(),
-                          SourceLocation(), &Idents.get(Fields[i].Name),
-                          Fields[i].Type, /*TInfo=*/nullptr,
-                          /*BitWidth=*/nullptr, /*Mutable=*/false, ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        *this, CFConstantStringTagDecl, SourceLocation(), SourceLocation(),
+        &Idents.get(Fields[i].Name), Fields[i].Type, /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     CFConstantStringTagDecl->addDecl(Field);
   }
@@ -8039,7 +8038,7 @@ QualType ASTContext::getBlockDescriptorType() const {
     FieldDecl *Field = FieldDecl::Create(
         *this, RD, SourceLocation(), SourceLocation(),
         &Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr, /*Mutable=*/false, ICIS_NoInit);
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     RD->addDecl(Field);
   }
@@ -8078,7 +8077,6 @@ QualType ASTContext::getBlockDescriptorExtendedType() const {
     FieldDecl *Field = FieldDecl::Create(
         *this, RD, SourceLocation(), SourceLocation(),
         &Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr,
         /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     RD->addDecl(Field);
@@ -9436,15 +9434,11 @@ CreateAArch64ABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9489,14 +9483,10 @@ static TypedefDecl *CreatePowerABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(*Context, VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        *Context, VaListTagDecl, SourceLocation(), SourceLocation(),
+        &Context->Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9547,15 +9537,11 @@ CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9599,16 +9585,12 @@ CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context) {
   VaListDecl->startDefinition();
 
   // void * __ap;
-  FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                       VaListDecl,
-                                       SourceLocation(),
-                                       SourceLocation(),
-                                       &Context->Idents.get("__ap"),
-                                       Context->getPointerType(Context->VoidTy),
-                                       /*TInfo=*/nullptr,
-                                       /*BitWidth=*/nullptr,
-                                       /*Mutable=*/false,
-                                       ICIS_NoInit);
+  FieldDecl *Field = FieldDecl::Create(
+      const_cast<ASTContext &>(*Context), VaListDecl, SourceLocation(),
+      SourceLocation(), &Context->Idents.get("__ap"),
+      Context->getPointerType(Context->VoidTy),
+      /*TInfo=*/nullptr,
+      /*Mutable=*/false, ICIS_NoInit);
   Field->setAccess(AS_public);
   VaListDecl->addDecl(Field);
 
@@ -9650,15 +9632,11 @@ CreateSystemZBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9704,7 +9682,6 @@ static TypedefDecl *CreateHexagonBuiltinVaListDecl(const ASTContext *Context) {
         const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
         SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
         /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr,
         /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index a0cd57e2e5ee0d..517d3332d07e07 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -4231,7 +4231,7 @@ ExpectedDecl ASTNodeImporter::VisitFieldDecl(FieldDecl *D) {
   FieldDecl *ToField;
   if (GetImportedOrCreateDecl(ToField, D, Importer.getToContext(), DC,
                               ToInnerLocStart, Loc, Name.getAsIdentifierInfo(),
-                              ToType, ToTInfo, ToBitWidth, D->isMutable(),
+                              ToType, ToTInfo, ToBitWidth, 0, D->isMutable(),
                               D->getInClassInitStyle()))
     return ToField;
 
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 741e908cf9bc56..e92cc00b23ed5c 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4555,16 +4555,26 @@ unsigned FunctionDecl::getODRHash() {
 FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
                              SourceLocation StartLoc, SourceLocation IdLoc,
                              const IdentifierInfo *Id, QualType T,
-                             TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+                             TypeSourceInfo *TInfo, Expr *BW,
+                             unsigned BitWidthValue, bool Mutable,
                              InClassInitStyle InitStyle) {
   return new (C, DC) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
-                               BW, Mutable, InitStyle);
+                               BW, BitWidthValue, Mutable, InitStyle);
+}
+
+FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
+                             SourceLocation StartLoc, SourceLocation IdLoc,
+                             const IdentifierInfo *Id, QualType T,
+                             TypeSourceInfo *TInfo, bool Mutable,
+                             InClassInitStyle InitStyle) {
+  return new (C, DC) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
+                               nullptr, 0, Mutable, InitStyle);
 }
 
 FieldDecl *FieldDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
-  return new (C, ID) FieldDecl(Field, nullptr, SourceLocation(),
-                               SourceLocation(), nullptr, QualType(), nullptr,
-                               nullptr, false, ICIS_NoInit);
+  return new (C, ID)
+      FieldDecl(Field, nullptr, SourceLocation(), SourceLocation(), nullptr,
+                QualType(), nullptr, false, ICIS_NoInit);
 }
 
 bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -4601,6 +4611,9 @@ void FieldDecl::setLazyInClassInitializer(LazyDeclStmtPtr NewInit) {
 
 unsigned FieldDecl::getBitWidthValue(const ASTContext &Ctx) const {
   assert(isBitField() && "not a bitfield");
+  // FIXME: 0 might be the actual value of the bitwidth.
+  if (BitWidthValue != 0)
+    return BitWidthValue;
   return getBitWidth()->EvaluateKnownConstInt(Ctx).getZExtValue();
 }
 
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 5c107325df30c6..a2ed670cd941ca 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -1833,7 +1833,8 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
                                    SourceLocation IdLoc,
                                    const IdentifierInfo *Id, QualType T,
                                    TypeSourceInfo *TInfo, AccessControl ac,
-                                   Expr *BW, bool synthesized) {
+                                   Expr *BW, unsigned BWValue,
+                                   bool synthesized) {
   if (DC) {
     // Ivar's can only appear in interfaces, implementations (via synthesized
     // properties), and class extensions (via direct declaration, or synthesized
@@ -1861,13 +1862,13 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
   }
 
   return new (C, DC) ObjCIvarDecl(DC, StartLoc, IdLoc, Id, T, TInfo, ac, BW,
-                                  synthesized);
+                                  BWValue, synthesized);
 }
 
 ObjCIvarDecl *ObjCIvarDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
-  return new (C, ID) ObjCIvarDecl(nullptr, SourceLocation(), SourceLocation(),
-                                  nullptr, QualType(), nullptr,
-                                  ObjCIvarDecl::None, nullptr, false);
+  return new (C, ID)
+      ObjCIvarDecl(nullptr, SourceLocation(), SourceLocation(), nullptr,
+                   QualType(), nullptr, ObjCIvarDecl::None, false);
 }
 
 ObjCInterfaceDecl *ObjCIvarDecl::getContainingInterface() {
@@ -1905,18 +1906,27 @@ QualType ObjCIvarDecl::getUsageType(QualType objectType) const {
 
 void ObjCAtDefsFieldDecl::anchor() {}
 
-ObjCAtDefsFieldDecl
-*ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
-                             SourceLocation StartLoc,  SourceLocation IdLoc,
-                             IdentifierInfo *Id, QualType T, Expr *BW) {
-  return new (C, DC) ObjCAtDefsFieldDecl(DC, StartLoc, IdLoc, Id, T, BW);
+ObjCAtDefsFieldDecl *ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
+                                                 SourceLocation StartLoc,
+                                                 SourceLocation IdLoc,
+                                                 IdentifierInfo *Id, QualType T,
+                                                 Expr *BW, unsigned BWValue) {
+  return new (C, DC)
+      ObjCAtDefsFieldDecl(DC, StartLoc, IdLoc, Id, T, BW, BWValue);
+}
+
+ObjCAtDefsFieldDecl *ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
+                                                 SourceLocation StartLoc,
+                                                 SourceLocation IdLoc,
+               ...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2024

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

Patch is 35.40 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/117732.diff

15 Files Affected:

  • (modified) clang/include/clang/AST/Decl.h (+22-4)
  • (modified) clang/include/clang/AST/DeclObjC.h (+27-7)
  • (modified) clang/include/clang/Sema/Sema.h (+1-1)
  • (modified) clang/lib/AST/ASTContext.cpp (+30-53)
  • (modified) clang/lib/AST/ASTImporter.cpp (+1-1)
  • (modified) clang/lib/AST/Decl.cpp (+18-5)
  • (modified) clang/lib/AST/DeclObjC.cpp (+22-12)
  • (modified) clang/lib/CodeGen/CGObjCMac.cpp (+7-7)
  • (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (+2-1)
  • (modified) clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp (+3-3)
  • (modified) clang/lib/CodeGen/CodeGenModule.cpp (+4-8)
  • (modified) clang/lib/Sema/HLSLExternalSemaSource.cpp (+3-3)
  • (modified) clang/lib/Sema/SemaDecl.cpp (+36-35)
  • (modified) clang/lib/Sema/SemaDeclObjC.cpp (+13-10)
  • (modified) clang/lib/Sema/SemaLambda.cpp (+1-1)
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 8c39ef3d5a9fa6..db3c86a09bfb49 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -3089,17 +3089,27 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
     // Active member if ISK is ISK_CapturedVLAType.
     const VariableArrayType *CapturedVLAType;
   };
+  unsigned BitWidthValue = 0;
 
 protected:
   FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
             SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
-            TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
-            InClassInitStyle InitStyle)
+            TypeSourceInfo *TInfo, bool Mutable, InClassInitStyle InitStyle)
+      : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc), BitField(false),
+        Mutable(Mutable), StorageKind((InitStorageKind)InitStyle),
+        CachedFieldIndex(0), Init() {}
+
+  FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
+            SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
+            TypeSourceInfo *TInfo, Expr *BW, unsigned BitWidthValue,
+            bool Mutable, InClassInitStyle InitStyle)
       : DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc), BitField(false),
         Mutable(Mutable), StorageKind((InitStorageKind)InitStyle),
         CachedFieldIndex(0), Init() {
-    if (BW)
+    if (BW) {
       setBitWidth(BW);
+      this->BitWidthValue = BitWidthValue;
+    }
   }
 
 public:
@@ -3109,7 +3119,15 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
   static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
                            SourceLocation StartLoc, SourceLocation IdLoc,
                            const IdentifierInfo *Id, QualType T,
-                           TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+                           TypeSourceInfo *TInfo, Expr *BW,
+                           unsigned BitWidthValue, bool Mutable,
+                           InClassInitStyle InitStyle);
+
+  /// For non-bit-fields.
+  static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
+                           SourceLocation StartLoc, SourceLocation IdLoc,
+                           const IdentifierInfo *Id, QualType T,
+                           TypeSourceInfo *TInfo, bool Mutable,
                            InClassInitStyle InitStyle);
 
   static FieldDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 4663603f797545..17bccfda784fed 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -1960,8 +1960,15 @@ class ObjCIvarDecl : public FieldDecl {
   ObjCIvarDecl(ObjCContainerDecl *DC, SourceLocation StartLoc,
                SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
                TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
-               bool synthesized)
-      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
+               unsigned BWValue, bool synthesized)
+      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW, BWValue,
+                  /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
+        DeclAccess(ac), Synthesized(synthesized) {}
+
+  ObjCIvarDecl(ObjCContainerDecl *DC, SourceLocation StartLoc,
+               SourceLocation IdLoc, const IdentifierInfo *Id, QualType T,
+               TypeSourceInfo *TInfo, AccessControl ac, bool synthesized)
+      : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo,
                   /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
         DeclAccess(ac), Synthesized(synthesized) {}
 
@@ -1970,7 +1977,8 @@ class ObjCIvarDecl : public FieldDecl {
                               SourceLocation StartLoc, SourceLocation IdLoc,
                               const IdentifierInfo *Id, QualType T,
                               TypeSourceInfo *TInfo, AccessControl ac,
-                              Expr *BW = nullptr, bool synthesized = false);
+                              Expr *BW = nullptr, unsigned BWValue = 0,
+                              bool synthesized = false);
 
   static ObjCIvarDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
 
@@ -2028,11 +2036,19 @@ class ObjCIvarDecl : public FieldDecl {
 /// Represents a field declaration created by an \@defs(...).
 class ObjCAtDefsFieldDecl : public FieldDecl {
   ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc,
-                      SourceLocation IdLoc, IdentifierInfo *Id,
-                      QualType T, Expr *BW)
+                      SourceLocation IdLoc, IdentifierInfo *Id, QualType T,
+                      Expr *BW, unsigned BWValue)
+      : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
+                  /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
+                  BW, BWValue, /*Mutable=*/false,
+                  /*HasInit=*/ICIS_NoInit) {}
+
+  ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc,
+                      SourceLocation IdLoc, IdentifierInfo *Id, QualType T)
       : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
                   /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
-                  BW, /*Mutable=*/false, /*HasInit=*/ICIS_NoInit) {}
+                  /*Mutable=*/false,
+                  /*HasInit=*/ICIS_NoInit) {}
 
   void anchor() override;
 
@@ -2040,7 +2056,11 @@ class ObjCAtDefsFieldDecl : public FieldDecl {
   static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC,
                                      SourceLocation StartLoc,
                                      SourceLocation IdLoc, IdentifierInfo *Id,
-                                     QualType T, Expr *BW);
+                                     QualType T, Expr *BW, unsigned BWValue);
+  static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC,
+                                     SourceLocation StartLoc,
+                                     SourceLocation IdLoc, IdentifierInfo *Id,
+                                     QualType T);
 
   static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C,
                                                  GlobalDeclID ID);
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 24abd5d95dd844..5c82a75f491e37 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -4277,7 +4277,7 @@ class Sema final : public SemaBase {
   /// Returns false on success.
   ExprResult VerifyBitField(SourceLocation FieldLoc,
                             const IdentifierInfo *FieldName, QualType FieldTy,
-                            bool IsMsStruct, Expr *BitWidth);
+                            bool IsMsStruct, Expr *BitWidth, unsigned &BWV);
 
   /// IsValueInFlagEnum - Determine if a value is allowed as part of a flag
   /// enum. If AllowMask is true, then we also allow the complement of a valid
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 80e8c5b9df58e7..26631f9a5c7f9b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -7969,11 +7969,10 @@ TypedefDecl *ASTContext::getCFConstantStringDecl() const {
 
   // Create fields
   for (unsigned i = 0; i < Count; ++i) {
-    FieldDecl *Field =
-        FieldDecl::Create(*this, CFConstantStringTagDecl, SourceLocation(),
-                          SourceLocation(), &Idents.get(Fields[i].Name),
-                          Fields[i].Type, /*TInfo=*/nullptr,
-                          /*BitWidth=*/nullptr, /*Mutable=*/false, ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        *this, CFConstantStringTagDecl, SourceLocation(), SourceLocation(),
+        &Idents.get(Fields[i].Name), Fields[i].Type, /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     CFConstantStringTagDecl->addDecl(Field);
   }
@@ -8039,7 +8038,7 @@ QualType ASTContext::getBlockDescriptorType() const {
     FieldDecl *Field = FieldDecl::Create(
         *this, RD, SourceLocation(), SourceLocation(),
         &Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr, /*Mutable=*/false, ICIS_NoInit);
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     RD->addDecl(Field);
   }
@@ -8078,7 +8077,6 @@ QualType ASTContext::getBlockDescriptorExtendedType() const {
     FieldDecl *Field = FieldDecl::Create(
         *this, RD, SourceLocation(), SourceLocation(),
         &Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr,
         /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     RD->addDecl(Field);
@@ -9436,15 +9434,11 @@ CreateAArch64ABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9489,14 +9483,10 @@ static TypedefDecl *CreatePowerABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(*Context, VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        *Context, VaListTagDecl, SourceLocation(), SourceLocation(),
+        &Context->Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9547,15 +9537,11 @@ CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9599,16 +9585,12 @@ CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context) {
   VaListDecl->startDefinition();
 
   // void * __ap;
-  FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                       VaListDecl,
-                                       SourceLocation(),
-                                       SourceLocation(),
-                                       &Context->Idents.get("__ap"),
-                                       Context->getPointerType(Context->VoidTy),
-                                       /*TInfo=*/nullptr,
-                                       /*BitWidth=*/nullptr,
-                                       /*Mutable=*/false,
-                                       ICIS_NoInit);
+  FieldDecl *Field = FieldDecl::Create(
+      const_cast<ASTContext &>(*Context), VaListDecl, SourceLocation(),
+      SourceLocation(), &Context->Idents.get("__ap"),
+      Context->getPointerType(Context->VoidTy),
+      /*TInfo=*/nullptr,
+      /*Mutable=*/false, ICIS_NoInit);
   Field->setAccess(AS_public);
   VaListDecl->addDecl(Field);
 
@@ -9650,15 +9632,11 @@ CreateSystemZBuiltinVaListDecl(const ASTContext *Context) {
 
   // Create fields
   for (unsigned i = 0; i < NumFields; ++i) {
-    FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
-                                         VaListTagDecl,
-                                         SourceLocation(),
-                                         SourceLocation(),
-                                         &Context->Idents.get(FieldNames[i]),
-                                         FieldTypes[i], /*TInfo=*/nullptr,
-                                         /*BitWidth=*/nullptr,
-                                         /*Mutable=*/false,
-                                         ICIS_NoInit);
+    FieldDecl *Field = FieldDecl::Create(
+        const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
+        SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
+        /*TInfo=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
   }
@@ -9704,7 +9682,6 @@ static TypedefDecl *CreateHexagonBuiltinVaListDecl(const ASTContext *Context) {
         const_cast<ASTContext &>(*Context), VaListTagDecl, SourceLocation(),
         SourceLocation(), &Context->Idents.get(FieldNames[i]), FieldTypes[i],
         /*TInfo=*/nullptr,
-        /*BitWidth=*/nullptr,
         /*Mutable=*/false, ICIS_NoInit);
     Field->setAccess(AS_public);
     VaListTagDecl->addDecl(Field);
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index a0cd57e2e5ee0d..517d3332d07e07 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -4231,7 +4231,7 @@ ExpectedDecl ASTNodeImporter::VisitFieldDecl(FieldDecl *D) {
   FieldDecl *ToField;
   if (GetImportedOrCreateDecl(ToField, D, Importer.getToContext(), DC,
                               ToInnerLocStart, Loc, Name.getAsIdentifierInfo(),
-                              ToType, ToTInfo, ToBitWidth, D->isMutable(),
+                              ToType, ToTInfo, ToBitWidth, 0, D->isMutable(),
                               D->getInClassInitStyle()))
     return ToField;
 
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 741e908cf9bc56..e92cc00b23ed5c 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4555,16 +4555,26 @@ unsigned FunctionDecl::getODRHash() {
 FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
                              SourceLocation StartLoc, SourceLocation IdLoc,
                              const IdentifierInfo *Id, QualType T,
-                             TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+                             TypeSourceInfo *TInfo, Expr *BW,
+                             unsigned BitWidthValue, bool Mutable,
                              InClassInitStyle InitStyle) {
   return new (C, DC) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
-                               BW, Mutable, InitStyle);
+                               BW, BitWidthValue, Mutable, InitStyle);
+}
+
+FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
+                             SourceLocation StartLoc, SourceLocation IdLoc,
+                             const IdentifierInfo *Id, QualType T,
+                             TypeSourceInfo *TInfo, bool Mutable,
+                             InClassInitStyle InitStyle) {
+  return new (C, DC) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
+                               nullptr, 0, Mutable, InitStyle);
 }
 
 FieldDecl *FieldDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
-  return new (C, ID) FieldDecl(Field, nullptr, SourceLocation(),
-                               SourceLocation(), nullptr, QualType(), nullptr,
-                               nullptr, false, ICIS_NoInit);
+  return new (C, ID)
+      FieldDecl(Field, nullptr, SourceLocation(), SourceLocation(), nullptr,
+                QualType(), nullptr, false, ICIS_NoInit);
 }
 
 bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -4601,6 +4611,9 @@ void FieldDecl::setLazyInClassInitializer(LazyDeclStmtPtr NewInit) {
 
 unsigned FieldDecl::getBitWidthValue(const ASTContext &Ctx) const {
   assert(isBitField() && "not a bitfield");
+  // FIXME: 0 might be the actual value of the bitwidth.
+  if (BitWidthValue != 0)
+    return BitWidthValue;
   return getBitWidth()->EvaluateKnownConstInt(Ctx).getZExtValue();
 }
 
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 5c107325df30c6..a2ed670cd941ca 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -1833,7 +1833,8 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
                                    SourceLocation IdLoc,
                                    const IdentifierInfo *Id, QualType T,
                                    TypeSourceInfo *TInfo, AccessControl ac,
-                                   Expr *BW, bool synthesized) {
+                                   Expr *BW, unsigned BWValue,
+                                   bool synthesized) {
   if (DC) {
     // Ivar's can only appear in interfaces, implementations (via synthesized
     // properties), and class extensions (via direct declaration, or synthesized
@@ -1861,13 +1862,13 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
   }
 
   return new (C, DC) ObjCIvarDecl(DC, StartLoc, IdLoc, Id, T, TInfo, ac, BW,
-                                  synthesized);
+                                  BWValue, synthesized);
 }
 
 ObjCIvarDecl *ObjCIvarDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
-  return new (C, ID) ObjCIvarDecl(nullptr, SourceLocation(), SourceLocation(),
-                                  nullptr, QualType(), nullptr,
-                                  ObjCIvarDecl::None, nullptr, false);
+  return new (C, ID)
+      ObjCIvarDecl(nullptr, SourceLocation(), SourceLocation(), nullptr,
+                   QualType(), nullptr, ObjCIvarDecl::None, false);
 }
 
 ObjCInterfaceDecl *ObjCIvarDecl::getContainingInterface() {
@@ -1905,18 +1906,27 @@ QualType ObjCIvarDecl::getUsageType(QualType objectType) const {
 
 void ObjCAtDefsFieldDecl::anchor() {}
 
-ObjCAtDefsFieldDecl
-*ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
-                             SourceLocation StartLoc,  SourceLocation IdLoc,
-                             IdentifierInfo *Id, QualType T, Expr *BW) {
-  return new (C, DC) ObjCAtDefsFieldDecl(DC, StartLoc, IdLoc, Id, T, BW);
+ObjCAtDefsFieldDecl *ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
+                                                 SourceLocation StartLoc,
+                                                 SourceLocation IdLoc,
+                                                 IdentifierInfo *Id, QualType T,
+                                                 Expr *BW, unsigned BWValue) {
+  return new (C, DC)
+      ObjCAtDefsFieldDecl(DC, StartLoc, IdLoc, Id, T, BW, BWValue);
+}
+
+ObjCAtDefsFieldDecl *ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
+                                                 SourceLocation StartLoc,
+                                                 SourceLocation IdLoc,
+               ...
[truncated]

@cor3ntin
Copy link
Contributor

Wouldn't wrapping the value in a ConstantExpr achieve the same outcome?

@tbaederr
Copy link
Contributor Author

@cor3ntin
Copy link
Contributor

The ConstantExpr version is much simpler, so I have a preference for that

@tbaederr
Copy link
Contributor Author

Meh, saving a ConstantExpr in the FieldDecl doesn't work properly, since we need to support having arbitrary exprs in case the bitwidth is dependent.

@erichkeane
Copy link
Collaborator

Meh, saving a ConstantExpr in the FieldDecl doesn't work properly, since we need to support having arbitrary exprs in case the bitwidth is dependent.

The idea is that you'd store an Expr like we do elsewhere, and then upon instantiating it/evaluating it, we'd replace it with a ConstantExpr. So you don't need separate storage, just replace the current thing.

The instantiation of a ConstantExpr is to just return it, so you don't end up losing anything as a side effect.

@tbaederr
Copy link
Contributor Author

Most recent result: http://llvm-compile-time-tracker.com/compare.php?from=6f16a8bf17ac9a171b5435ee53c3d2bef657bdad&to=65e10089b0ca8e2103e6fcf6b082d2bebd3ef458&stat=instructions%3Au

The idea is that you'd store an Expr like we do elsewhere, and then upon instantiating it/evaluating it, we'd replace it with a ConstantExpr. So you don't need separate storage, just replace the current thing.

I was more thinking about other consumers of clang as as a library, e.g. FieldDecl::setBitWidth() ensuring that the bitwidth expression is a ConstantExpr, but that doesn't work properly because of the reasons above. I'm now asserting the type in getBitWidthValue() instead.

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

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

This seems really reasonable to me. I'd like @cor3ntin to do a final approval here, but this seems right to me (though I might have gotten lost in the various only vaguely-related parts of this change :) ).

@tbaederr
Copy link
Contributor Author

Ping @cor3ntin

@tbaederr tbaederr force-pushed the perf/bwv branch 2 times, most recently from 663a7c5 to 980c977 Compare December 11, 2024 10:16
@tbaederr
Copy link
Contributor Author

Ping

1 similar comment
@tbaederr
Copy link
Contributor Author

tbaederr commented Jan 2, 2025

Ping

@erichkeane
Copy link
Collaborator

I was/still am OK with this, but wanted @cor3ntin to take a final pass.

@tbaederr
Copy link
Contributor Author

tbaederr commented Jan 7, 2025

Yep, that's what I was pinging for :)

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

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

This is neat.
Sorry for the delay

@tbaederr
Copy link
Contributor Author

tbaederr commented Jan 8, 2025

Python binding tests fail for unrelated reasons:

  curl: (23) Failure writing output to destination
  Error: Restoring cache failed: Error: The process '/usr/bin/sh' failed with exit code 2

@tbaederr tbaederr merged commit 81fc3ad into llvm:main Jan 8, 2025
8 of 10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 8, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building clang-tools-extra,clang at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/13647

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
14.724 [1/2/71] Linking CXX executable tools/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests
16.219 [1/1/72] Linking CXX executable bin/lldb-test
16.219 [0/1/72] Running lldb lit test suite
llvm-lit: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using clang: /home/worker/2.0.1/lldb-x86_64-debian/build/bin/clang
llvm-lit: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/worker/2.0.1/lldb-x86_64-debian/build/bin/ld.lld
llvm-lit: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/worker/2.0.1/lldb-x86_64-debian/build/bin/lld-link
llvm-lit: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/worker/2.0.1/lldb-x86_64-debian/build/bin/ld64.lld
llvm-lit: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/worker/2.0.1/lldb-x86_64-debian/build/bin/wasm-ld
-- Testing: 2738 tests, 72 workers --
UNRESOLVED: lldb-api :: functionalities/gdb_remote_client/TestXMLRegisterFlags.py (1 of 2738)
******************** TEST 'lldb-api :: functionalities/gdb_remote_client/TestXMLRegisterFlags.py' FAILED ********************
Script:
--
/usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/functionalities/gdb_remote_client -p TestXMLRegisterFlags.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 81fc3add1e627c23b7270fe2739cdacc09063e54)
  clang revision 81fc3add1e627c23b7270fe2739cdacc09063e54
  llvm revision 81fc3add1e627c23b7270fe2739cdacc09063e54
python3          ProcessGDBRemote::ConnectToDebugserver Connecting to connect://[::1]:34261
python3          <   1> send packet: +
python3          history[1] tid=0x3c26c <   1> send packet: +
python3          <  19> send packet: $QStartNoAckMode#b0
python3          <   1> read packet: +
python3          <   6> read packet: $OK#9a
python3          <   1> send packet: +
python3          < 104> send packet: $qSupported:xmlRegisters=i386,arm,mips,arc;multiprocess+;fork-events+;vfork-events+;swbreak+;hwbreak+#cd
python3          <  57> read packet: $qXfer:features:read+;PacketSize=3fff;QStartNoAckMode+#86
python3          <  26> send packet: $QThreadSuffixSupported#e4
python3          <   4> read packet: $#00
python3          <  27> send packet: $QListThreadsInStopReply#21
python3          <   4> read packet: $#00
python3          <  13> send packet: $qHostInfo#9b
python3          <  28> read packet: $ptrsize:8;endian:little;#30
python3          <  10> send packet: $vCont?#49
python3          <   4> read packet: $#00
python3          <  27> send packet: $qVAttachOrWaitSupported#38
python3          <   4> read packet: $#00
python3          <  23> send packet: $QEnableErrorStrings#8c
python3          <   6> read packet: $OK#9a
python3          ProcessGDBRemote::StartAsyncThread ()
python3          <  16> send packet: $qProcessInfo#dc
b-remote.async>  ProcessGDBRemote::AsyncThread(pid = 0) thread starting...
b-remote.async>  ProcessGDBRemote::AsyncThread(pid = 0) listener.WaitForEvent (NULL, event_sp)...
python3          <   4> read packet: $#00
python3          <   6> send packet: $qC#b4

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 8, 2025

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building clang-tools-extra,clang at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/9471

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: commands/command/script/import/rdar-12586188/TestRdar12586188.py (25 of 2863)
PASS: lldb-api :: commands/command/script/import/TestImport.py (26 of 2863)
PASS: lldb-api :: commands/command/script_alias/TestCommandScriptAlias.py (27 of 2863)
PASS: lldb-api :: commands/command/source/TestCommandSource.py (28 of 2863)
PASS: lldb-api :: commands/disassemble/basic/TestDisassembleBreakpoint.py (29 of 2863)
PASS: lldb-api :: commands/disassemble/basic/TestFrameDisassemble.py (30 of 2863)
PASS: lldb-api :: commands/command/script/TestCommandScript.py (31 of 2863)
PASS: lldb-api :: commands/expression/anonymous-struct/TestCallUserAnonTypedef.py (32 of 2863)
PASS: lldb-api :: commands/expression/argument_passing_restrictions/TestArgumentPassingRestrictions.py (33 of 2863)
UNRESOLVED: lldb-api :: commands/expression/bitfield_enums/TestBitfieldEnums.py (34 of 2863)
******************** TEST 'lldb-api :: commands/expression/bitfield_enums/TestBitfieldEnums.py' FAILED ********************
Script:
--
/usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --arch armv8l --build-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/commands/expression/bitfield_enums -p TestBitfieldEnums.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 81fc3add1e627c23b7270fe2739cdacc09063e54)
  clang revision 81fc3add1e627c23b7270fe2739cdacc09063e54
  llvm revision 81fc3add1e627c23b7270fe2739cdacc09063e54

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_bitfield_enums_dsym (TestBitfieldEnums.TestBitfieldEnum) (test case does not fall in any category of interest for this run) 
python3.10: ../llvm-project/clang/lib/AST/Decl.cpp:4604: unsigned int clang::FieldDecl::getBitWidthValue() const: Assertion `isa<ConstantExpr>(getBitWidth())' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	<eof> parser at end of file
1.	<lldb wrapper prefix>:43:1: Generating code for declaration '$__lldb_expr'
#0 0xf162e0dc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
#1 0xf162bb3c llvm::sys::RunSignalHandlers() Signals.cpp:0:0
#2 0xf162e970 SignalHandler(int) Signals.cpp:0:0
#3 0xf7d7d6e0 __default_sa_restorer ./signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67:0
#4 0xf7d6db06 ./csu/../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47:0
#5 0xf7dad292 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0xf7d7c840 gsignal ./signal/../sysdeps/posix/raise.c:27:6

--

********************
PASS: lldb-api :: commands/expression/calculator_mode/TestCalculatorMode.py (35 of 2863)
PASS: lldb-api :: commands/expression/call-function/TestCallBuiltinFunction.py (36 of 2863)
PASS: lldb-api :: commands/expression/call-function/TestCallStdStringFunction.py (37 of 2863)
PASS: lldb-api :: commands/expression/call-function/TestCallStopAndContinue.py (38 of 2863)
PASS: lldb-api :: commands/expression/call-restarts/TestCallThatRestarts.py (39 of 2863)
PASS: lldb-api :: commands/expression/call-function/TestCallUserDefinedFunction.py (40 of 2863)

tbaederr added a commit that referenced this pull request Jan 8, 2025
This reverts commit 81fc3ad.

This breaks some LLDB tests, e.g.
SymbolFile/DWARF/x86/no_unique_address-with-bitfields.cpp:

lldb: ../llvm-project/clang/lib/AST/Decl.cpp:4604: unsigned int clang::FieldDecl::getBitWidthValue() const: Assertion `isa<ConstantExpr>(getBitWidth())' failed.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 8, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building clang-tools-extra,clang at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/10743

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: commands/command/script/import/TestImport.py (24 of 2064)
PASS: lldb-api :: commands/command/script_alias/TestCommandScriptAlias.py (25 of 2064)
PASS: lldb-api :: commands/command/source/TestCommandSource.py (26 of 2064)
PASS: lldb-api :: commands/command/backticks/TestBackticksInAlias.py (27 of 2064)
PASS: lldb-api :: commands/disassemble/basic/TestFrameDisassemble.py (28 of 2064)
PASS: lldb-api :: commands/disassemble/basic/TestDisassembleBreakpoint.py (29 of 2064)
PASS: lldb-api :: commands/expression/calculator_mode/TestCalculatorMode.py (30 of 2064)
PASS: lldb-api :: commands/expression/anonymous-struct/TestCallUserAnonTypedef.py (31 of 2064)
PASS: lldb-api :: commands/expression/argument_passing_restrictions/TestArgumentPassingRestrictions.py (32 of 2064)
UNRESOLVED: lldb-api :: commands/expression/bitfield_enums/TestBitfieldEnums.py (33 of 2064)
******************** TEST 'lldb-api :: commands/expression/bitfield_enums/TestBitfieldEnums.py' FAILED ********************
Script:
--
/usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/commands/expression/bitfield_enums -p TestBitfieldEnums.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 81fc3add1e627c23b7270fe2739cdacc09063e54)
  clang revision 81fc3add1e627c23b7270fe2739cdacc09063e54
  llvm revision 81fc3add1e627c23b7270fe2739cdacc09063e54

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_bitfield_enums_dsym (TestBitfieldEnums.TestBitfieldEnum) (test case does not fall in any category of interest for this run) 
python3.10: ../llvm-project/clang/lib/AST/Decl.cpp:4604: unsigned int clang::FieldDecl::getBitWidthValue() const: Assertion `isa<ConstantExpr>(getBitWidth())' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	<eof> parser at end of file
1.	<lldb wrapper prefix>:43:1: Generating code for declaration '$__lldb_expr'
  #0 0x0000ffff7a51ddc0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
  #1 0x0000ffff7a51be1c llvm::sys::RunSignalHandlers() Signals.cpp:0:0
  #2 0x0000ffff7a51e4d0 SignalHandler(int) Signals.cpp:0:0
  #3 0x0000ffff814337dc (linux-vdso.so.1+0x7dc)
  #4 0x0000ffff811bf200 __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
  #5 0x0000ffff8117a67c gsignal ./signal/../sysdeps/posix/raise.c:27:6
  #6 0x0000ffff81167130 abort ./stdlib/./stdlib/abort.c:81:7
  #7 0x0000ffff81173fd0 __assert_fail_base ./assert/./assert/assert.c:89:7
  #8 0x0000ffff81174040 __assert_perror_fail ./assert/./assert/assert-perr.c:31:1
  #9 0x0000ffff7e00b5b4 clang::FieldDecl::getBitWidthValue() const Decl.cpp:0:0
 #10 0x0000ffff7e446dc8 (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutField(clang::FieldDecl const*, bool) RecordLayoutBuilder.cpp:0:0
 #11 0x0000ffff7e4443e4 (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutFields(clang::RecordDecl const*) RecordLayoutBuilder.cpp:0:0
 #12 0x0000ffff7e43c99c clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const RecordLayoutBuilder.cpp:0:0
 #13 0x0000ffff7c228f38 lldb_private::ClangASTImporter::importRecordLayoutFromOrigin(clang::RecordDecl const*, unsigned long&, unsigned long&, llvm::DenseMap<clang::FieldDecl const*, unsigned long, llvm::DenseMapInfo<clang::FieldDecl const*, void>, llvm::detail::DenseMapPair<clang::FieldDecl const*, unsigned long> >&, llvm::DenseMap<clang::CXXRecordDecl const*, clang::CharUnits, llvm::DenseMapInfo<clang::CXXRecordDecl const*, void>, llvm::detail::DenseMapPair<clang::CXXRecordDecl const*, clang::CharUnits> >&, llvm::DenseMap<clang::CXXRecordDecl const*, clang::CharUnits, llvm::DenseMapInfo<clang::CXXRecordDecl const*, void>, llvm::detail::DenseMapPair<clang::CXXRecordDecl const*, clang::CharUnits> >&) ClangASTImporter.cpp:0:0
 #14 0x0000ffff7e4441d4 (anonymous namespace)::ItaniumRecordLayoutBuilder::InitializeLayout(clang::Decl const*) RecordLayoutBuilder.cpp:0:0
 #15 0x0000ffff7e43aa00 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const RecordLayoutBuilder.cpp:0:0
 #16 0x0000ffff7c484ae0 clang::CodeGen::CodeGenModule::getClassPointerAlignment(clang::CXXRecordDecl const*) CGClass.cpp:0:0

tbaederr added a commit to tbaederr/llvm-project that referenced this pull request Jan 9, 2025
tbaederr added a commit to tbaederr/llvm-project that referenced this pull request Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:loongarch backend:RISC-V backend:X86 clang:as-a-library libclang and C++ API clang:codegen IR generation bugs: mangling, exceptions, etc. clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:static analyzer clang Clang issues not falling into any other category clang-tidy clang-tools-extra clangd debuginfo HLSL HLSL Language Support
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants