[all-commits] [llvm/llvm-project] 9f499d: [HLSL] Support HLSL vector initializers

Chris B via All-commits all-commits at lists.llvm.org
Tue Jun 21 10:34:03 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f499d9d73edfc818978c64eb24b8d2d34995d76
  Author: Chris Bieneman <chris.bieneman at me.com>
  Date:   2022-06-21 (Tue, 21 Jun 2022)

  Changed paths:
    M clang/lib/Sema/SemaInit.cpp
    A clang/test/AST/HLSL/vector-constructors.hlsl
    A clang/test/SemaHLSL/BuiltIns/vector-constructors-erros.hlsl

  Log Message:
  [HLSL] Support HLSL vector initializers

In HLSL vectors are ext_vectors in all respects except that they
support a constructor style syntax for initializing vectors. This
change adds a translation of vector constructor arguments into
initializer lists.

This supports two oddities of HLSL syntax:
(1) HLSL vectors support constructor syntax
(2) HLSL vectors are expanded to constituate components in constructors

Reviewed By: aaron.ballman

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

More information about the All-commits mailing list