[all-commits] [llvm/llvm-project] ef2b17: [Sema][HLSL] Consolidate handling of HLSL attributes

Justin Bogner via All-commits all-commits at lists.llvm.org
Tue Aug 29 09:00:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef2b1700f4648816e6a6ce27cfee1c501421ee50
      https://github.com/llvm/llvm-project/commit/ef2b1700f4648816e6a6ce27cfee1c501421ee50
  Author: Justin Bogner <mail at justinbogner.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/CodeGenHLSL/GlobalDestructors.hlsl
    M clang/test/SemaHLSL/Semantics/entry_parameter.hlsl
    A clang/test/SemaHLSL/Semantics/groupindex.hlsl
    M clang/test/SemaHLSL/entry.hlsl
    A clang/test/SemaHLSL/entry_shader_redecl.hlsl
    M clang/test/SemaHLSL/num_threads.hlsl

  Log Message:
  -----------
  [Sema][HLSL] Consolidate handling of HLSL attributes

This moves the sema checking of the entrypoint sensitive HLSL
attributes all into one place. This ended up being kind of large for a
couple of reasons:

- I had to move the call to CheckHLSLEntryPoint later in
  ActOnFunctionDeclarator so that we do this after redeclarations and
  have access to all of the attributes.

- We need to transfer the target shader stage onto the specified entry
  point before doing the checking.

- I removed "library" from the HLSLShader attribute value enum and
  just go through a string to convert from the triple - the other way
  was confusing and brittle.

Differential Revision: https://reviews.llvm.org/D158803




More information about the All-commits mailing list