[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-23 Thread Joshua Batista via cfe-commits

https://github.com/bob80905 edited 
https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-22 Thread Chris B via cfe-commits

https://github.com/llvm-beanz approved this pull request.


https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-22 Thread Joshua Batista via cfe-commits

https://github.com/bob80905 updated 
https://github.com/llvm/llvm-project/pull/89309

>From 58f7f1c7f99f29fea39b5bd83bb74d3770a6f985 Mon Sep 17 00:00:00 2001
From: Joshua Batista 
Date: Thu, 18 Apr 2024 13:38:51 -0700
Subject: [PATCH 1/2] rename hlsl semantics to hlsl annotations

---
 clang/include/clang/Basic/Attr.td | 10 ++--
 .../include/clang/Basic/AttributeCommonInfo.h |  6 +--
 clang/include/clang/Parse/Parser.h| 20 
 clang/lib/Parse/ParseDecl.cpp |  6 +--
 clang/lib/Parse/ParseHLSL.cpp | 18 
 clang/utils/TableGen/ClangAttrEmitter.cpp | 46 ++-
 6 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/clang/include/clang/Basic/Attr.td 
b/clang/include/clang/Basic/Attr.td
index dc87a8c6f022dc..4408d517e70e58 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -368,8 +368,8 @@ class Clang
   bit AllowInC = allowInC;
 }
 
-// HLSL Semantic spellings
-class HLSLSemantic : Spelling;
+// HLSL Annotation spellings
+class HLSLAnnotation : Spelling;
 
 class Accessor spellings> {
   string Name = name;
@@ -4358,14 +4358,14 @@ def HLSLNumThreads: InheritableAttr {
 }
 
 def HLSLSV_GroupIndex: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_GroupIndex">];
+  let Spellings = [HLSLAnnotation<"SV_GroupIndex">];
   let Subjects = SubjectList<[ParmVar, GlobalVar]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_GroupIndexDocs];
 }
 
 def HLSLResourceBinding: InheritableAttr {
-  let Spellings = [HLSLSemantic<"register">];
+  let Spellings = [HLSLAnnotation<"register">];
   let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar]>;
   let LangOpts = [HLSL];
   let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
@@ -4373,7 +4373,7 @@ def HLSLResourceBinding: InheritableAttr {
 }
 
 def HLSLSV_DispatchThreadID: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_DispatchThreadID">];
+  let Spellings = [HLSLAnnotation<"SV_DispatchThreadID">];
   let Subjects = SubjectList<[ParmVar, Field]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_DispatchThreadIDDocs];
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h 
b/clang/include/clang/Basic/AttributeCommonInfo.h
index ef2ddf525c9814..5f024b4b5fd782 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -52,8 +52,8 @@ class AttributeCommonInfo {
 /// Context-sensitive version of a keyword attribute.
 AS_ContextSensitiveKeyword,
 
-///  : 
-AS_HLSLSemantic,
+///  : 
+AS_HLSLAnnotation,
 
 /// The attibute has no source code manifestation and is only created
 /// implicitly.
@@ -120,7 +120,7 @@ class AttributeCommonInfo {
 }
 static Form Pragma() { return AS_Pragma; }
 static Form ContextSensitiveKeyword() { return AS_ContextSensitiveKeyword; 
}
-static Form HLSLSemantic() { return AS_HLSLSemantic; }
+static Form HLSLAnnotation() { return AS_HLSLAnnotation; }
 static Form Implicit() { return AS_Implicit; }
 
   private:
diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index 23b268126de4e0..b4d13ec9d13b59 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -2967,25 +2967,25 @@ class Parser : public CodeCompletionHandler {
   Sema::AttributeCompletion Completion = Sema::AttributeCompletion::None,
   const IdentifierInfo *EnclosingScope = nullptr);
 
-  void MaybeParseHLSLSemantics(Declarator ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(Declarator ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (Tok.is(tok::colon)) {
   ParsedAttributes Attrs(AttrFactory);
-  ParseHLSLSemantics(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc);
   D.takeAttributes(Attrs);
 }
   }
 
-  void MaybeParseHLSLSemantics(ParsedAttributes ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(ParsedAttributes ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (getLangOpts().HLSL && Tok.is(tok::colon))
-  ParseHLSLSemantics(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc);
   }
 
-  void ParseHLSLSemantics(ParsedAttributes ,
-  SourceLocation *EndLoc = nullptr);
+  void ParseHLSLAnnotations(ParsedAttributes ,
+SourceLocation *EndLoc = nullptr);
   Decl *ParseHLSLBuffer(SourceLocation );
 
   void 

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Cooper Partin via cfe-commits

https://github.com/coopp approved this pull request.

Looks good

https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Cooper Partin via cfe-commits


@@ -4890,15 +4890,16 @@ class SpellingList {
   }
 
   void add(const Record , FlattenedSpelling Spelling) {
-SpellingKind Kind = StringSwitch(Spelling.variety())
-.Case("GNU", SpellingKind::GNU)
-.Case("CXX11", SpellingKind::CXX11)
-.Case("C23", SpellingKind::C23)
-.Case("Declspec", SpellingKind::Declspec)
-.Case("Microsoft", SpellingKind::Microsoft)
-.Case("Keyword", SpellingKind::Keyword)
-.Case("Pragma", SpellingKind::Pragma)
-.Case("HLSLSemantic", SpellingKind::HLSLSemantic);
+SpellingKind Kind =

coopp wrote:

Did clang-format shift all of this code over?

https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Xiang Li via cfe-commits

https://github.com/python3kgae approved this pull request.


https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Justin Bogner via cfe-commits

https://github.com/bogner approved this pull request.


https://github.com/llvm/llvm-project/pull/89309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Joshua Batista (bob80905)


Changes

The attribute name "HLSLSemantics" is confusing, because semantics aren't 
always the annotation that are applied to specific variables. The name for this 
attribute needs to be less specific. This PR changes the attribute name from 
HLSLSemantic to HLSLAnnotation, and changes the associated function and 
variable names to support this conceptual change. 
The HLSLAnnotation attribute will never be output in ast-dump due to it being 
parsed for the attribute that it represents. There is no functional change, so 
there are no accompanying tests.

---
Full diff: https://github.com/llvm/llvm-project/pull/89309.diff


6 Files Affected:

- (modified) clang/include/clang/Basic/Attr.td (+5-5) 
- (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+3-3) 
- (modified) clang/include/clang/Parse/Parser.h (+10-10) 
- (modified) clang/lib/Parse/ParseDecl.cpp (+3-3) 
- (modified) clang/lib/Parse/ParseHLSL.cpp (+8-10) 
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+24-22) 


``diff
diff --git a/clang/include/clang/Basic/Attr.td 
b/clang/include/clang/Basic/Attr.td
index dc87a8c6f022dc..4408d517e70e58 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -368,8 +368,8 @@ class Clang
   bit AllowInC = allowInC;
 }
 
-// HLSL Semantic spellings
-class HLSLSemantic : Spelling;
+// HLSL Annotation spellings
+class HLSLAnnotation : Spelling;
 
 class Accessor spellings> {
   string Name = name;
@@ -4358,14 +4358,14 @@ def HLSLNumThreads: InheritableAttr {
 }
 
 def HLSLSV_GroupIndex: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_GroupIndex">];
+  let Spellings = [HLSLAnnotation<"SV_GroupIndex">];
   let Subjects = SubjectList<[ParmVar, GlobalVar]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_GroupIndexDocs];
 }
 
 def HLSLResourceBinding: InheritableAttr {
-  let Spellings = [HLSLSemantic<"register">];
+  let Spellings = [HLSLAnnotation<"register">];
   let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar]>;
   let LangOpts = [HLSL];
   let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
@@ -4373,7 +4373,7 @@ def HLSLResourceBinding: InheritableAttr {
 }
 
 def HLSLSV_DispatchThreadID: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_DispatchThreadID">];
+  let Spellings = [HLSLAnnotation<"SV_DispatchThreadID">];
   let Subjects = SubjectList<[ParmVar, Field]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_DispatchThreadIDDocs];
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h 
b/clang/include/clang/Basic/AttributeCommonInfo.h
index ef2ddf525c9814..5f024b4b5fd782 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -52,8 +52,8 @@ class AttributeCommonInfo {
 /// Context-sensitive version of a keyword attribute.
 AS_ContextSensitiveKeyword,
 
-///  : 
-AS_HLSLSemantic,
+///  : 
+AS_HLSLAnnotation,
 
 /// The attibute has no source code manifestation and is only created
 /// implicitly.
@@ -120,7 +120,7 @@ class AttributeCommonInfo {
 }
 static Form Pragma() { return AS_Pragma; }
 static Form ContextSensitiveKeyword() { return AS_ContextSensitiveKeyword; 
}
-static Form HLSLSemantic() { return AS_HLSLSemantic; }
+static Form HLSLAnnotation() { return AS_HLSLAnnotation; }
 static Form Implicit() { return AS_Implicit; }
 
   private:
diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index 23b268126de4e0..b4d13ec9d13b59 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -2967,25 +2967,25 @@ class Parser : public CodeCompletionHandler {
   Sema::AttributeCompletion Completion = Sema::AttributeCompletion::None,
   const IdentifierInfo *EnclosingScope = nullptr);
 
-  void MaybeParseHLSLSemantics(Declarator ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(Declarator ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (Tok.is(tok::colon)) {
   ParsedAttributes Attrs(AttrFactory);
-  ParseHLSLSemantics(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc);
   D.takeAttributes(Attrs);
 }
   }
 
-  void MaybeParseHLSLSemantics(ParsedAttributes ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(ParsedAttributes ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (getLangOpts().HLSL && Tok.is(tok::colon))
-  

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-hlsl

Author: Joshua Batista (bob80905)


Changes

The attribute name "HLSLSemantics" is confusing, because semantics aren't 
always the annotation that are applied to specific variables. The name for this 
attribute needs to be less specific. This PR changes the attribute name from 
HLSLSemantic to HLSLAnnotation, and changes the associated function and 
variable names to support this conceptual change. 
The HLSLAnnotation attribute will never be output in ast-dump due to it being 
parsed for the attribute that it represents. There is no functional change, so 
there are no accompanying tests.

---
Full diff: https://github.com/llvm/llvm-project/pull/89309.diff


6 Files Affected:

- (modified) clang/include/clang/Basic/Attr.td (+5-5) 
- (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+3-3) 
- (modified) clang/include/clang/Parse/Parser.h (+10-10) 
- (modified) clang/lib/Parse/ParseDecl.cpp (+3-3) 
- (modified) clang/lib/Parse/ParseHLSL.cpp (+8-10) 
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+24-22) 


``diff
diff --git a/clang/include/clang/Basic/Attr.td 
b/clang/include/clang/Basic/Attr.td
index dc87a8c6f022dc..4408d517e70e58 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -368,8 +368,8 @@ class Clang
   bit AllowInC = allowInC;
 }
 
-// HLSL Semantic spellings
-class HLSLSemantic : Spelling;
+// HLSL Annotation spellings
+class HLSLAnnotation : Spelling;
 
 class Accessor spellings> {
   string Name = name;
@@ -4358,14 +4358,14 @@ def HLSLNumThreads: InheritableAttr {
 }
 
 def HLSLSV_GroupIndex: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_GroupIndex">];
+  let Spellings = [HLSLAnnotation<"SV_GroupIndex">];
   let Subjects = SubjectList<[ParmVar, GlobalVar]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_GroupIndexDocs];
 }
 
 def HLSLResourceBinding: InheritableAttr {
-  let Spellings = [HLSLSemantic<"register">];
+  let Spellings = [HLSLAnnotation<"register">];
   let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar]>;
   let LangOpts = [HLSL];
   let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
@@ -4373,7 +4373,7 @@ def HLSLResourceBinding: InheritableAttr {
 }
 
 def HLSLSV_DispatchThreadID: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_DispatchThreadID">];
+  let Spellings = [HLSLAnnotation<"SV_DispatchThreadID">];
   let Subjects = SubjectList<[ParmVar, Field]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_DispatchThreadIDDocs];
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h 
b/clang/include/clang/Basic/AttributeCommonInfo.h
index ef2ddf525c9814..5f024b4b5fd782 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -52,8 +52,8 @@ class AttributeCommonInfo {
 /// Context-sensitive version of a keyword attribute.
 AS_ContextSensitiveKeyword,
 
-///  : 
-AS_HLSLSemantic,
+///  : 
+AS_HLSLAnnotation,
 
 /// The attibute has no source code manifestation and is only created
 /// implicitly.
@@ -120,7 +120,7 @@ class AttributeCommonInfo {
 }
 static Form Pragma() { return AS_Pragma; }
 static Form ContextSensitiveKeyword() { return AS_ContextSensitiveKeyword; 
}
-static Form HLSLSemantic() { return AS_HLSLSemantic; }
+static Form HLSLAnnotation() { return AS_HLSLAnnotation; }
 static Form Implicit() { return AS_Implicit; }
 
   private:
diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index 23b268126de4e0..b4d13ec9d13b59 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -2967,25 +2967,25 @@ class Parser : public CodeCompletionHandler {
   Sema::AttributeCompletion Completion = Sema::AttributeCompletion::None,
   const IdentifierInfo *EnclosingScope = nullptr);
 
-  void MaybeParseHLSLSemantics(Declarator ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(Declarator ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (Tok.is(tok::colon)) {
   ParsedAttributes Attrs(AttrFactory);
-  ParseHLSLSemantics(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc);
   D.takeAttributes(Attrs);
 }
   }
 
-  void MaybeParseHLSLSemantics(ParsedAttributes ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(ParsedAttributes ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (getLangOpts().HLSL && Tok.is(tok::colon))
-  

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Joshua Batista via cfe-commits

https://github.com/bob80905 created 
https://github.com/llvm/llvm-project/pull/89309

The attribute name "HLSLSemantics" is confusing, because semantics aren't 
always the annotation that are applied to specific variables. The name for this 
attribute needs to be less specific. This PR changes the attribute name from 
HLSLSemantic to HLSLAnnotation, and changes the associated function and 
variable names to support this conceptual change. 
The HLSLAnnotation attribute will never be output in ast-dump due to it being 
parsed for the attribute that it represents. There is no functional change, so 
there are no accompanying tests.

>From 58f7f1c7f99f29fea39b5bd83bb74d3770a6f985 Mon Sep 17 00:00:00 2001
From: Joshua Batista 
Date: Thu, 18 Apr 2024 13:38:51 -0700
Subject: [PATCH] rename hlsl semantics to hlsl annotations

---
 clang/include/clang/Basic/Attr.td | 10 ++--
 .../include/clang/Basic/AttributeCommonInfo.h |  6 +--
 clang/include/clang/Parse/Parser.h| 20 
 clang/lib/Parse/ParseDecl.cpp |  6 +--
 clang/lib/Parse/ParseHLSL.cpp | 18 
 clang/utils/TableGen/ClangAttrEmitter.cpp | 46 ++-
 6 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/clang/include/clang/Basic/Attr.td 
b/clang/include/clang/Basic/Attr.td
index dc87a8c6f022dc..4408d517e70e58 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -368,8 +368,8 @@ class Clang
   bit AllowInC = allowInC;
 }
 
-// HLSL Semantic spellings
-class HLSLSemantic : Spelling;
+// HLSL Annotation spellings
+class HLSLAnnotation : Spelling;
 
 class Accessor spellings> {
   string Name = name;
@@ -4358,14 +4358,14 @@ def HLSLNumThreads: InheritableAttr {
 }
 
 def HLSLSV_GroupIndex: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_GroupIndex">];
+  let Spellings = [HLSLAnnotation<"SV_GroupIndex">];
   let Subjects = SubjectList<[ParmVar, GlobalVar]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_GroupIndexDocs];
 }
 
 def HLSLResourceBinding: InheritableAttr {
-  let Spellings = [HLSLSemantic<"register">];
+  let Spellings = [HLSLAnnotation<"register">];
   let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar]>;
   let LangOpts = [HLSL];
   let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
@@ -4373,7 +4373,7 @@ def HLSLResourceBinding: InheritableAttr {
 }
 
 def HLSLSV_DispatchThreadID: HLSLAnnotationAttr {
-  let Spellings = [HLSLSemantic<"SV_DispatchThreadID">];
+  let Spellings = [HLSLAnnotation<"SV_DispatchThreadID">];
   let Subjects = SubjectList<[ParmVar, Field]>;
   let LangOpts = [HLSL];
   let Documentation = [HLSLSV_DispatchThreadIDDocs];
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h 
b/clang/include/clang/Basic/AttributeCommonInfo.h
index ef2ddf525c9814..5f024b4b5fd782 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -52,8 +52,8 @@ class AttributeCommonInfo {
 /// Context-sensitive version of a keyword attribute.
 AS_ContextSensitiveKeyword,
 
-///  : 
-AS_HLSLSemantic,
+///  : 
+AS_HLSLAnnotation,
 
 /// The attibute has no source code manifestation and is only created
 /// implicitly.
@@ -120,7 +120,7 @@ class AttributeCommonInfo {
 }
 static Form Pragma() { return AS_Pragma; }
 static Form ContextSensitiveKeyword() { return AS_ContextSensitiveKeyword; 
}
-static Form HLSLSemantic() { return AS_HLSLSemantic; }
+static Form HLSLAnnotation() { return AS_HLSLAnnotation; }
 static Form Implicit() { return AS_Implicit; }
 
   private:
diff --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index 23b268126de4e0..b4d13ec9d13b59 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -2967,25 +2967,25 @@ class Parser : public CodeCompletionHandler {
   Sema::AttributeCompletion Completion = Sema::AttributeCompletion::None,
   const IdentifierInfo *EnclosingScope = nullptr);
 
-  void MaybeParseHLSLSemantics(Declarator ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(Declarator ,
+ SourceLocation *EndLoc = nullptr) {
+assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (Tok.is(tok::colon)) {
   ParsedAttributes Attrs(AttrFactory);
-  ParseHLSLSemantics(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc);
   D.takeAttributes(Attrs);
 }
   }
 
-  void MaybeParseHLSLSemantics(ParsedAttributes ,
-   SourceLocation *EndLoc = nullptr) {
-assert(getLangOpts().HLSL && "MaybeParseHLSLSemantics is for HLSL only");
+  void MaybeParseHLSLAnnotations(ParsedAttributes ,
+ SourceLocation *EndLoc =