[all-commits] [llvm/llvm-project] 73417c: [HLSL][clang][Driver] Support validator version co...

Xiang Li via All-commits all-commits at lists.llvm.org
Fri Apr 29 16:49:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73417c517644db5c419c85c0b3cb6750172fcab5
      https://github.com/llvm/llvm-project/commit/73417c517644db5c419c85c0b3cb6750172fcab5
  Author: python3kgae <python3kgae at outlook.com>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Basic/TargetOptions.h
    M clang/include/clang/Driver/Options.td
    A clang/lib/CodeGen/CGHLSLRuntime.cpp
    A clang/lib/CodeGen/CGHLSLRuntime.h
    M clang/lib/CodeGen/CMakeLists.txt
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/HLSL.cpp
    M clang/lib/Driver/ToolChains/HLSL.h
    A clang/test/CodeGenHLSL/validator_version.hlsl
    M clang/unittests/Driver/ToolChainTest.cpp

  Log Message:
  -----------
  [HLSL][clang][Driver] Support validator version command line option.

The DXIL validator version option(/validator-version) decide the validator version when compile hlsl.
The format is major.minor like 1.0.

In normal case, the value of validator version should be got from DXIL validator. Before we got DXIL validator ready for llvm/main, DXIL validator version option is added first to set validator version.

It will affect code generation for DXIL, so it is treated as a code gen option.

A new member std::string DxilValidatorVersion is added to clang::CodeGenOptions.

Then CGHLSLRuntime is added to clang::CodeGenModule.
It is used to translate clang::CodeGenOptions::DxilValidatorVersion into a ModuleFlag under key "dx.valver" at end of clang code generation.

Reviewed By: beanz

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




More information about the All-commits mailing list