[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
llvm-beanz wrote: > There is still logic elsewhere that sets the default entry point to "main", > right? This looks right to me. Yes, and we apply the HLSLShader attribute to main and key generating the entry off that in clangCodeGen. https://github.com/llvm/llvm-project/pull/110546 _

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/3] [HLSL] Treat `main` as any other function HLSL doesn't

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/2] [HLSL] Treat `main` as any other function HLSL doesn't

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
@@ -1,7 +1,7 @@ // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ // RUN: spirv-pc-vulkan-library %s -emit-llvm -disable-llvm-passes -o - | FileCheck %s -// CHECK: define spir_func void @main() [[A0:#[0-9]+]] { +// CHECK: define spir_func void @{{.

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
@@ -4,7 +4,7 @@ // SPIRV: error: '-fnative-half-type' option requires target HLSL Version >= 2018, but HLSL Version is 'hlsl2016' // valid: "spirv-unknown-vulkan-library" -// valid: define spir_func void @main() #0 { +// valid: define spir_func void @{{.*}}main{{.*}}() #0 { -

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. There is still logic elsewhere that sets the default entry point to "main", right? This looks right to me. https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. This fixes the problem in #108567 https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/110546 HLSL doesn't distinguish `main` from any other function. It does treat entry points special, but they're not required to be called `main` so we have a different attribute annotation to mark them. At the mom

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl @llvm/pr-subscribers-clang Author: Chris B (llvm-beanz) Changes HLSL doesn't distinguish `main` from any other function. It does treat entry points special, but they're not required to be called `main` so we have a different attribute annotation t