[clang] [HLSL] Parameter modifier parsing and AST (PR #72139)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 09:33:58 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 0e42df4031e8b2fec357e07ca5ca3b81adf0b5ad b99d291f99805bc090b8e51b8f8ad176a7cdd642 -- clang/include/clang/Sema/Sema.h clang/lib/AST/TypePrinter.cpp clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseTentative.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaType.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index fdcd10d924..316e9c129b 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -3732,8 +3732,9 @@ public:
                                               int X, int Y, int Z);
   HLSLShaderAttr *mergeHLSLShaderAttr(Decl *D, const AttributeCommonInfo &AL,
                                       HLSLShaderAttr::ShaderType ShaderType);
-  HLSLParamModifierAttr *mergeHLSLParamModifierAttr(Decl *D, const AttributeCommonInfo &AL,
-                                      HLSLParamModifierAttr::Spelling Spelling);
+  HLSLParamModifierAttr *
+  mergeHLSLParamModifierAttr(Decl *D, const AttributeCommonInfo &AL,
+                             HLSLParamModifierAttr::Spelling Spelling);
 
   void mergeDeclAttributes(NamedDecl *New, Decl *Old,
                            AvailabilityMergeKind AMK = AMK_Redeclaration);
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index cf9a940076..f694124292 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -1894,7 +1894,7 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
   case attr::ArmMveStrictPolymorphism:
     OS << "__clang_arm_mve_strict_polymorphism";
     break;
-  
+
   // Nothing to print for this attribute.
   case attr::HLSLParamModifier:
     break;
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6ea113ec08..37a9472595 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3388,7 +3388,6 @@ static void mergeParamDeclAttributes(ParmVarDecl *newDecl,
     }
   }
 
-
   if (!oldDecl->hasAttrs())
     return;
 
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index dacd80c7d2..cb384d6690 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -8661,8 +8661,8 @@ static void HandleLifetimeBoundAttr(TypeProcessingState &State,
   }
 }
 
-static void HandleHLSLParamModifierAttr(QualType &CurType, const ParsedAttr &Attr,
-                                 Sema &S) {
+static void HandleHLSLParamModifierAttr(QualType &CurType,
+                                        const ParsedAttr &Attr, Sema &S) {
   if (Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_inout ||
       Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_out)
     CurType = S.getASTContext().getLValueReferenceType(CurType);

``````````

</details>


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


More information about the cfe-commits mailing list