This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa162b67c9806: [Clang][Attr] rename btf_tag to btf_decl_tag 
(authored by yonghong-song).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111588/new/

https://reviews.llvm.org/D111588

Files:
  clang/include/clang/Basic/Attr.td
  clang/include/clang/Basic/AttrDocs.td
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGDebugInfo.h
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CodeGen/attr-btf_tag-dicomposite-2.c
  clang/test/CodeGen/attr-btf_tag-dicomposite.c
  clang/test/CodeGen/attr-btf_tag-diglobalvariable.c
  clang/test/CodeGen/attr-btf_tag-disubprogram-callsite.c
  clang/test/CodeGen/attr-btf_tag-disubprogram.c
  clang/test/CodeGen/attr-btf_tag-field.c
  clang/test/CodeGen/attr-btf_tag-parameter.c
  clang/test/Misc/pragma-attribute-supported-attributes-list.test
  clang/test/Sema/attr-btf_tag.c

Index: clang/test/Sema/attr-btf_tag.c
===================================================================
--- clang/test/Sema/attr-btf_tag.c
+++ clang/test/Sema/attr-btf_tag.c
@@ -1,12 +1,12 @@
 // RUN: %clang_cc1 -x c -triple x86_64-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
-#define __tag3 __attribute__((btf_tag("tag3")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
+#define __tag3 __attribute__((btf_decl_tag("tag3")))
 
-#define __tag_no_arg __attribute__((btf_tag()))
-#define __tag_2_arg __attribute__((btf_tag("tag1", "tag2")))
-#define __invalid __attribute__((btf_tag(1)))
+#define __tag_no_arg __attribute__((btf_decl_tag()))
+#define __tag_2_arg __attribute__((btf_decl_tag("tag1", "tag2")))
+#define __invalid __attribute__((btf_decl_tag(1)))
 
 struct __tag1 __tag2 t1;
 struct t1 {
@@ -19,21 +19,21 @@
 };
 
 int g1 __tag1;
-int g2 __tag_no_arg; // expected-error {{'btf_tag' attribute takes one argument}}
-int g3 __tag_2_arg; // expected-error {{'btf_tag' attribute takes one argument}}
-int i1 __invalid; // expected-error {{'btf_tag' attribute requires a string}}
+int g2 __tag_no_arg; // expected-error {{'btf_decl_tag' attribute takes one argument}}
+int g3 __tag_2_arg; // expected-error {{'btf_decl_tag' attribute takes one argument}}
+int i1 __invalid; // expected-error {{'btf_decl_tag' attribute requires a string}}
 
 enum e1 {
   E1
-} __tag1; // expected-error {{'btf_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
+} __tag1; // expected-error {{'btf_decl_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
 
 enum e2 {
   E2
-} __tag_no_arg; // expected-error {{'btf_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
+} __tag_no_arg; // expected-error {{'btf_decl_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
 
 enum e3 {
   E3
-} __tag_2_arg; // expected-error {{'btf_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
+} __tag_2_arg; // expected-error {{'btf_decl_tag' attribute only applies to variables, functions, structs, unions, classes, and non-static data members}}
 
 int __tag1 __tag2 foo(struct t1 *arg, struct t2 *arg2);
 int __tag2 __tag3 foo(struct t1 *arg, struct t2 *arg2);
Index: clang/test/Misc/pragma-attribute-supported-attributes-list.test
===================================================================
--- clang/test/Misc/pragma-attribute-supported-attributes-list.test
+++ clang/test/Misc/pragma-attribute-supported-attributes-list.test
@@ -22,7 +22,7 @@
 // CHECK-NEXT: Assumption (SubjectMatchRule_function, SubjectMatchRule_objc_method)
 // CHECK-NEXT: Availability ((SubjectMatchRule_record, SubjectMatchRule_enum, SubjectMatchRule_enum_constant, SubjectMatchRule_field, SubjectMatchRule_function, SubjectMatchRule_namespace, SubjectMatchRule_objc_category, SubjectMatchRule_objc_implementation, SubjectMatchRule_objc_interface, SubjectMatchRule_objc_method, SubjectMatchRule_objc_property, SubjectMatchRule_objc_protocol, SubjectMatchRule_record, SubjectMatchRule_type_alias, SubjectMatchRule_variable))
 // CHECK-NEXT: BPFPreserveAccessIndex (SubjectMatchRule_record)
-// CHECK-NEXT: BTFTag (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record, SubjectMatchRule_field)
+// CHECK-NEXT: BTFDeclTag (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record, SubjectMatchRule_field)
 // CHECK-NEXT: BuiltinAlias (SubjectMatchRule_function)
 // CHECK-NEXT: CFAuditedTransfer (SubjectMatchRule_function)
 // CHECK-NEXT: CFConsumed (SubjectMatchRule_variable_is_parameter)
Index: clang/test/CodeGen/attr-btf_tag-parameter.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-parameter.c
+++ clang/test/CodeGen/attr-btf_tag-parameter.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct t1 {
   int a;
@@ -14,5 +14,5 @@
 
 // CHECK: !DILocalVariable(name: "arg", arg: 1, scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], annotations: ![[ANNOT:[0-9]+]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
Index: clang/test/CodeGen/attr-btf_tag-field.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-field.c
+++ clang/test/CodeGen/attr-btf_tag-field.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct t1 {
   int a __tag1 __tag2;
@@ -21,7 +21,7 @@
 }
 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "a", scope: ![[#]], file: ![[#]], line: [[#]], baseType: ![[#]], size: 32, annotations: ![[ANNOT:[0-9]+]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
 
 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "b", scope: ![[#]], file: ![[#]], line: [[#]], baseType: ![[#]], size: 1, flags: DIFlagBitField, extraData: i64 0, annotations: ![[ANNOT]])
Index: clang/test/CodeGen/attr-btf_tag-disubprogram.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-disubprogram.c
+++ clang/test/CodeGen/attr-btf_tag-disubprogram.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct t1 {
   int a;
@@ -14,8 +14,8 @@
 
 // CHECK: distinct !DISubprogram(name: "foo", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], scopeLine: [[#]], flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: ![[#]], retainedNodes: ![[#]], annotations: ![[ANNOT:[0-9]+]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
 
 int __tag1 __tag2 foo2(struct t1 *arg);
 int foo2(struct t1 *arg) {
Index: clang/test/CodeGen/attr-btf_tag-disubprogram-callsite.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-disubprogram-callsite.c
+++ clang/test/CodeGen/attr-btf_tag-disubprogram-callsite.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -O2 -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct t1 {
   int a;
@@ -15,5 +15,5 @@
 
 // CHECK: ![[#]] = !DISubprogram(name: "foo", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: ![[#]], annotations: ![[ANNOT:[0-9]+]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
Index: clang/test/CodeGen/attr-btf_tag-diglobalvariable.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-diglobalvariable.c
+++ clang/test/CodeGen/attr-btf_tag-diglobalvariable.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct t1 {
   int a;
@@ -15,8 +15,8 @@
 // CHECK: distinct !DIGlobalVariable(name: "g1", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT:[0-9]+]])
 // CHECK: distinct !DIGlobalVariable(name: "g2", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
 
 extern struct t1 g3 __tag1;
 struct t1 g3 __tag2;
Index: clang/test/CodeGen/attr-btf_tag-dicomposite.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-dicomposite.c
+++ clang/test/CodeGen/attr-btf_tag-dicomposite.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct __tag1 __tag2 t1;
 struct t1 {
@@ -15,8 +15,8 @@
 
 // CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "t1", file: ![[#]], line: [[#]], size: 32, elements: ![[#]], annotations: ![[ANNOT:[0-9]+]])
 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
-// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"}
-// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"}
+// CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
+// CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
 
 struct __tag1 t2;
 struct __tag2 t2 {
Index: clang/test/CodeGen/attr-btf_tag-dicomposite-2.c
===================================================================
--- clang/test/CodeGen/attr-btf_tag-dicomposite-2.c
+++ clang/test/CodeGen/attr-btf_tag-dicomposite-2.c
@@ -1,8 +1,8 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
 
-#define __tag1 __attribute__((btf_tag("tag1")))
-#define __tag2 __attribute__((btf_tag("tag2")))
+#define __tag1 __attribute__((btf_decl_tag("tag1")))
+#define __tag2 __attribute__((btf_decl_tag("tag2")))
 
 struct __tag1 __tag2 t1;
 
Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -6887,28 +6887,28 @@
   Rec->addAttr(::new (S.Context) BPFPreserveAccessIndexAttr(S.Context, AL));
 }
 
-static bool hasBTFTagAttr(Decl *D, StringRef Tag) {
-  for (const auto *I : D->specific_attrs<BTFTagAttr>()) {
-    if (I->getBTFTag() == Tag)
+static bool hasBTFDeclTagAttr(Decl *D, StringRef Tag) {
+  for (const auto *I : D->specific_attrs<BTFDeclTagAttr>()) {
+    if (I->getBTFDeclTag() == Tag)
       return true;
   }
   return false;
 }
 
-static void handleBTFTagAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+static void handleBTFDeclTagAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
   StringRef Str;
   if (!S.checkStringLiteralArgumentAttr(AL, 0, Str))
     return;
-  if (hasBTFTagAttr(D, Str))
+  if (hasBTFDeclTagAttr(D, Str))
     return;
 
-  D->addAttr(::new (S.Context) BTFTagAttr(S.Context, AL, Str));
+  D->addAttr(::new (S.Context) BTFDeclTagAttr(S.Context, AL, Str));
 }
 
-BTFTagAttr *Sema::mergeBTFTagAttr(Decl *D, const BTFTagAttr &AL) {
-  if (hasBTFTagAttr(D, AL.getBTFTag()))
+BTFDeclTagAttr *Sema::mergeBTFDeclTagAttr(Decl *D, const BTFDeclTagAttr &AL) {
+  if (hasBTFDeclTagAttr(D, AL.getBTFDeclTag()))
     return nullptr;
-  return ::new (Context) BTFTagAttr(Context, AL, AL.getBTFTag());
+  return ::new (Context) BTFDeclTagAttr(Context, AL, AL.getBTFDeclTag());
 }
 
 static void handleWebAssemblyExportNameAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
@@ -7947,8 +7947,8 @@
   case ParsedAttr::AT_BPFPreserveAccessIndex:
     handleBPFPreserveAccessIndexAttr(S, D, AL);
     break;
-  case ParsedAttr::AT_BTFTag:
-    handleBTFTagAttr(S, D, AL);
+  case ParsedAttr::AT_BTFDeclTag:
+    handleBTFDeclTagAttr(S, D, AL);
     break;
   case ParsedAttr::AT_WebAssemblyExportName:
     handleWebAssemblyExportNameAttr(S, D, AL);
Index: clang/lib/Sema/SemaDecl.cpp
===================================================================
--- clang/lib/Sema/SemaDecl.cpp
+++ clang/lib/Sema/SemaDecl.cpp
@@ -2679,8 +2679,8 @@
     NewAttr = S.mergeEnforceTCBAttr(D, *TCBA);
   else if (const auto *TCBLA = dyn_cast<EnforceTCBLeafAttr>(Attr))
     NewAttr = S.mergeEnforceTCBLeafAttr(D, *TCBLA);
-  else if (const auto *BTFA = dyn_cast<BTFTagAttr>(Attr))
-    NewAttr = S.mergeBTFTagAttr(D, *BTFA);
+  else if (const auto *BTFA = dyn_cast<BTFDeclTagAttr>(Attr))
+    NewAttr = S.mergeBTFDeclTagAttr(D, *BTFA);
   else if (Attr->shouldInheritEvenIfAlreadyPresent() || !DeclHasAttr(D, Attr))
     NewAttr = cast<InheritableAttr>(Attr->clone(S.Context));
 
Index: clang/lib/CodeGen/CGDebugInfo.h
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.h
+++ clang/lib/CodeGen/CGDebugInfo.h
@@ -300,8 +300,8 @@
   llvm::DINodeArray CollectCXXTemplateParams(const RecordDecl *TS,
                                              llvm::DIFile *F);
 
-  /// A helper function to collect debug info for btf_tag annotations.
-  llvm::DINodeArray CollectBTFTagAnnotations(const Decl *D);
+  /// A helper function to collect debug info for btf_decl_tag annotations.
+  llvm::DINodeArray CollectBTFDeclTagAnnotations(const Decl *D);
 
   llvm::DIType *createFieldType(StringRef name, QualType type,
                                 SourceLocation loc, AccessSpecifier AS,
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1424,7 +1424,7 @@
     Offset = BitFieldInfo.StorageSize - BitFieldInfo.Size - Offset;
   uint64_t OffsetInBits = StorageOffsetInBits + Offset;
   llvm::DINode::DIFlags Flags = getAccessFlag(BitFieldDecl->getAccess(), RD);
-  llvm::DINodeArray Annotations = CollectBTFTagAnnotations(BitFieldDecl);
+  llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(BitFieldDecl);
   return DBuilder.createBitFieldMemberType(
       RecordTy, Name, File, Line, SizeInBits, OffsetInBits, StorageOffsetInBits,
       Flags, DebugType, Annotations);
@@ -1541,7 +1541,7 @@
     FieldType = createBitFieldType(field, RecordTy, RD);
   } else {
     auto Align = getDeclAlignIfRequired(field, CGM.getContext());
-    llvm::DINodeArray Annotations = CollectBTFTagAnnotations(field);
+    llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(field);
     FieldType =
         createFieldType(name, type, field->getLocation(), field->getAccess(),
                         OffsetInBits, Align, tunit, RecordTy, RD, Annotations);
@@ -2141,15 +2141,15 @@
   return CollectTemplateParams(GetTemplateArgs(RD), Unit);
 }
 
-llvm::DINodeArray CGDebugInfo::CollectBTFTagAnnotations(const Decl *D) {
-  if (!D->hasAttr<BTFTagAttr>())
+llvm::DINodeArray CGDebugInfo::CollectBTFDeclTagAnnotations(const Decl *D) {
+  if (!D->hasAttr<BTFDeclTagAttr>())
     return nullptr;
 
   SmallVector<llvm::Metadata *, 4> Annotations;
-  for (const auto *I : D->specific_attrs<BTFTagAttr>()) {
+  for (const auto *I : D->specific_attrs<BTFDeclTagAttr>()) {
     llvm::Metadata *Ops[2] = {
-        llvm::MDString::get(CGM.getLLVMContext(), StringRef("btf_tag")),
-        llvm::MDString::get(CGM.getLLVMContext(), I->getBTFTag())};
+        llvm::MDString::get(CGM.getLLVMContext(), StringRef("btf_decl_tag")),
+        llvm::MDString::get(CGM.getLLVMContext(), I->getBTFDeclTag())};
     Annotations.push_back(llvm::MDNode::get(CGM.getLLVMContext(), Ops));
   }
   return DBuilder.getOrCreateArray(Annotations);
@@ -3527,7 +3527,7 @@
         Flags |= llvm::DINode::FlagExportSymbols;
   }
 
-  llvm::DINodeArray Annotations = CollectBTFTagAnnotations(D);
+  llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(D);
   llvm::DICompositeType *RealDecl = DBuilder.createReplaceableCompositeType(
       getTagForRecord(RD), RDName, RDContext, DefUnit, Line, 0, Size, Align,
       Flags, Identifier, Annotations);
@@ -4047,7 +4047,7 @@
     Decl = isa<ObjCMethodDecl>(D)
                ? getObjCMethodDeclaration(D, DIFnType, LineNo, Flags, SPFlags)
                : getFunctionDeclaration(D);
-    Annotations = CollectBTFTagAnnotations(D);
+    Annotations = CollectBTFDeclTagAnnotations(D);
   }
 
   // FIXME: The function declaration we're constructing here is mostly reusing
@@ -4117,7 +4117,7 @@
   if (CGM.getLangOpts().Optimize)
     SPFlags |= llvm::DISubprogram::SPFlagOptimized;
 
-  llvm::DINodeArray Annotations = CollectBTFTagAnnotations(D);
+  llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(D);
   llvm::DISubprogram *SP = DBuilder.createFunction(
       FDContext, Name, LinkageName, Unit, LineNo,
       getOrCreateFunctionType(D, FnType, Unit), ScopeLine, Flags, SPFlags,
@@ -4458,7 +4458,7 @@
   // Create the descriptor for the variable.
   llvm::DILocalVariable *D = nullptr;
   if (ArgNo) {
-    llvm::DINodeArray Annotations = CollectBTFTagAnnotations(VD);
+    llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(VD);
     D = DBuilder.createParameterVariable(Scope, Name, *ArgNo, Unit, Line, Ty,
                                          CGM.getLangOpts().Optimize, Flags,
                                          Annotations);
@@ -5079,7 +5079,7 @@
     }
     AppendAddressSpaceXDeref(AddressSpace, Expr);
 
-    llvm::DINodeArray Annotations = CollectBTFTagAnnotations(D);
+    llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(D);
     GVE = DBuilder.createGlobalVariableExpression(
         DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
         Var->hasLocalLinkage(), true,
Index: clang/include/clang/Sema/Sema.h
===================================================================
--- clang/include/clang/Sema/Sema.h
+++ clang/include/clang/Sema/Sema.h
@@ -3390,7 +3390,7 @@
   EnforceTCBAttr *mergeEnforceTCBAttr(Decl *D, const EnforceTCBAttr &AL);
   EnforceTCBLeafAttr *mergeEnforceTCBLeafAttr(Decl *D,
                                               const EnforceTCBLeafAttr &AL);
-  BTFTagAttr *mergeBTFTagAttr(Decl *D, const BTFTagAttr &AL);
+  BTFDeclTagAttr *mergeBTFDeclTagAttr(Decl *D, const BTFDeclTagAttr &AL);
 
   void mergeDeclAttributes(NamedDecl *New, Decl *Old,
                            AvailabilityMergeKind AMK = AMK_Redeclaration);
Index: clang/include/clang/Basic/AttrDocs.td
===================================================================
--- clang/include/clang/Basic/AttrDocs.td
+++ clang/include/clang/Basic/AttrDocs.td
@@ -2011,12 +2011,12 @@
 struct or union, similar to clang ``__builtin_preserve_access_index()``.
   }];
 }
-def BTFTagDocs : Documentation {
+def BTFDeclTagDocs : Documentation {
   let Category = DocCatFunction;
   let Content = [{
-Clang supports the ``__attribute__((btf_tag("ARGUMENT")))`` attribute for all
-targets. This attribute may be attached to a struct/union, struct/union field,
-function, function parameter or variable declaration. If -g is specified,
+Clang supports the ``__attribute__((btf_decl_tag("ARGUMENT")))`` attribute for
+all targets. This attribute may be attached to a struct/union, struct/union
+field, function, function parameter or variable declaration. If -g is specified,
 the ``ARGUMENT`` info will be preserved in IR and be emitted to dwarf.
 For BPF targets, the ``ARGUMENT`` info will be emitted to .BTF ELF section too.
   }];
Index: clang/include/clang/Basic/Attr.td
===================================================================
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -1836,11 +1836,11 @@
   let LangOpts = [COnly];
 }
 
-def BTFTag : InheritableAttr {
-  let Spellings = [Clang<"btf_tag">];
-  let Args = [StringArgument<"BTFTag">];
+def BTFDeclTag : InheritableAttr {
+  let Spellings = [Clang<"btf_decl_tag">];
+  let Args = [StringArgument<"BTFDeclTag">];
   let Subjects = SubjectList<[Var, Function, Record, Field], ErrorDiag>;
-  let Documentation = [BTFTagDocs];
+  let Documentation = [BTFDeclTagDocs];
   let LangOpts = [COnly];
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to