Skip to content

[HLSL] Use hidden visibility for external linkage. #140292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 16, 2025

Conversation

s-perron
Copy link
Contributor

Implements
https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md.

The change is to stop using the hlsl.export attribute. Instead,
symbols with "program linkage" in HLSL will have export linkage with
default visibility, and symbols with "external linkage" in HLSL will
have export linkage with hidden visibility.

@s-perron s-perron requested a review from pow2clk May 16, 2025 18:23
@s-perron
Copy link
Contributor Author

FYI: @pow2clk Here is a possible implementation for https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md. I still need to update tests, but the change seems simple enough.

@s-perron s-perron force-pushed the hidden_visibility branch from 7738afa to af7ac50 Compare May 16, 2025 18:26
Implements
https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md.

The change is to stop using the `hlsl.export` attribute. Instead,
symbols with "program linkage" in HLSL will have export linkage with
default visibility, and symbols with "external linkage" in HLSL will
have export linkage with hidden visibility.
@s-perron s-perron force-pushed the hidden_visibility branch from af7ac50 to 99289ef Compare June 13, 2025 15:36
@s-perron s-perron requested a review from Keenuts June 13, 2025 15:37
@s-perron s-perron marked this pull request as ready for review June 13, 2025 15:37
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. backend:DirectX HLSL HLSL Language Support backend:SPIR-V labels Jun 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 13, 2025

@llvm/pr-subscribers-backend-directx
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-hlsl

@llvm/pr-subscribers-clang-codegen

Author: Steven Perron (s-perron)

Changes

Implements
https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md.

The change is to stop using the hlsl.export attribute. Instead,
symbols with "program linkage" in HLSL will have export linkage with
default visibility, and symbols with "external linkage" in HLSL will
have export linkage with hidden visibility.


Patch is 406.68 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140292.diff

112 Files Affected:

  • (modified) clang/lib/CodeGen/CGHLSLRuntime.cpp (-8)
  • (modified) clang/lib/CodeGen/CodeGenFunction.cpp (-1)
  • (modified) clang/lib/CodeGen/CodeGenModule.cpp (+5)
  • (modified) clang/test/CodeGenHLSL/ArrayAssignable.hlsl (+15-15)
  • (modified) clang/test/CodeGenHLSL/ArrayTemporary.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/BasicFeatures/ArrayOutputArguments.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/BasicFeatures/InitLists.hlsl (+18-18)
  • (modified) clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl (+8-8)
  • (modified) clang/test/CodeGenHLSL/Bool.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/BoolVector.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/basic_types.hlsl (+32-32)
  • (modified) clang/test/CodeGenHLSL/builtins/AddUint64.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/ByteAddressBuffers-constructors.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/builtins/GroupMemoryBarrierWithGroupSync.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/builtins/ScalarSwizzles.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/builtins/StructuredBuffers-constructors.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/builtins/abs.hlsl (+28-28)
  • (modified) clang/test/CodeGenHLSL/builtins/all.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/and.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/builtins/any.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/ceil-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/ceil.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/clamp-overloads.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/clamp.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/clip-builtin.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/builtins/clip.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/cos-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/cos.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/cross.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/degrees-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/degrees.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/distance.hlsl (+16-16)
  • (modified) clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/exp.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/exp2.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/floor-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/floor.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/fmod.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/frac-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/frac.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/hlsl_resource_t.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/builtins/isinf-overloads.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/isinf.hlsl (+8-8)
  • (modified) clang/test/CodeGenHLSL/builtins/ldexp.hlsl (+8-8)
  • (modified) clang/test/CodeGenHLSL/builtins/length.hlsl (+16-29)
  • (modified) clang/test/CodeGenHLSL/builtins/lerp-overloads.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/log-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/log.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/log10-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/log10.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/log2-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/log2.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/max-overloads.hlsl (+11-11)
  • (modified) clang/test/CodeGenHLSL/builtins/max.hlsl (+40-40)
  • (modified) clang/test/CodeGenHLSL/builtins/min-overloads.hlsl (+11-11)
  • (modified) clang/test/CodeGenHLSL/builtins/min.hlsl (+41-41)
  • (modified) clang/test/CodeGenHLSL/builtins/normalize-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/normalize.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/or.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/builtins/pow-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/pow.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/radians-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/radians.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/rcp.hlsl (+32-32)
  • (modified) clang/test/CodeGenHLSL/builtins/reflect.hlsl (+16-16)
  • (modified) clang/test/CodeGenHLSL/builtins/reversebits.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/round-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/round.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/rsqrt-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/rsqrt.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/sign.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/sin-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/sin.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/smoothstep.hlsl (+16-16)
  • (modified) clang/test/CodeGenHLSL/builtins/splitdouble.hlsl (+5-5)
  • (modified) clang/test/CodeGenHLSL/builtins/sqrt-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/sqrt.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/step-overloads.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/step.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/builtins/trunc-overloads.hlsl (+20-20)
  • (modified) clang/test/CodeGenHLSL/builtins/trunc.hlsl (+12-12)
  • (modified) clang/test/CodeGenHLSL/builtins/wave_get_lane_index_do_while.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/builtins/wave_get_lane_index_simple.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/builtins/wave_get_lane_index_subcall.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/cbuffer.hlsl (+46-46)
  • (modified) clang/test/CodeGenHLSL/cbuffer_and_namespaces.hlsl (+4-4)
  • (modified) clang/test/CodeGenHLSL/cbuffer_with_packoffset.hlsl (+5-5)
  • (modified) clang/test/CodeGenHLSL/cbuffer_with_static_global_and_function.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/convergence/do.while.hlsl (+5-5)
  • (modified) clang/test/CodeGenHLSL/convergence/for.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/convergence/while.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/default_cbuffer.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/default_cbuffer_with_layout.hlsl (+6-6)
  • (modified) clang/test/CodeGenHLSL/export.hlsl (+4-6)
  • (modified) clang/test/CodeGenHLSL/group_shared.hlsl (+1-1)
  • (modified) clang/test/CodeGenHLSL/implicit-norecurse-attrib.hlsl (+5-6)
  • (modified) clang/test/CodeGenHLSL/inline-functions.hlsl (+8-9)
  • (modified) clang/test/CodeGenHLSL/inline-spirv/SpirvType.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/no_int_promotion.hlsl (+7-7)
  • (modified) clang/test/CodeGenHLSL/out-of-line-static.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/shift-mask.hlsl (+8-8)
  • (modified) clang/test/CodeGenHLSL/this-assignment-overload.hlsl (+2-2)
  • (modified) clang/test/CodeGenHLSL/vk-input-builtin.hlsl (+1-1)
  • (modified) llvm/lib/Target/DirectX/DXILFinalizeLinkage.cpp (+3-1)
  • (modified) llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp (+2-1)
  • (modified) llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp (+2-1)
  • (modified) llvm/test/CodeGen/DirectX/finalize-linkage-remove-dead-lib.ll (+28-49)
  • (modified) llvm/test/CodeGen/DirectX/finalize-linkage-remove-dead.ll (+23-23)
  • (modified) llvm/test/CodeGen/DirectX/finalize_linkage.ll (+12-13)
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index 720dac8383c05..af259ad93e058 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -501,14 +501,6 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD,
   }
 }
 
-void CGHLSLRuntime::setHLSLFunctionAttributes(const FunctionDecl *FD,
-                                              llvm::Function *Fn) {
-  if (FD->isInExportDeclContext()) {
-    const StringRef ExportAttrKindStr = "hlsl.export";
-    Fn->addFnAttr(ExportAttrKindStr);
-  }
-}
-
 static void gatherFunctions(SmallVectorImpl<Function *> &Fns, llvm::Module &M,
                             bool CtorOrDtor) {
   const auto *GV =
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 56562002e7194..c7e3158e1710d 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1266,7 +1266,6 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
     if (FD->hasAttr<HLSLShaderAttr>()) {
       CGM.getHLSLRuntime().emitEntryFunction(FD, Fn);
     }
-    CGM.getHLSLRuntime().setHLSLFunctionAttributes(FD, Fn);
   }
 
   EmitFunctionProlog(*CurFnInfo, CurFn, Args);
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 16e49aab4fe61..aa5ddd0f488d9 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1661,6 +1661,11 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
     return;
   }
 
+  if (Context.getLangOpts().HLSL && !D->isInExportDeclContext()) {
+    GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
+    return;
+  }
+
   if (GV->hasDLLExportStorageClass() || GV->hasDLLImportStorageClass()) {
     // Reject incompatible dlllstorage and visibility annotations.
     if (!LV.isVisibilityExplicit())
diff --git a/clang/test/CodeGenHLSL/ArrayAssignable.hlsl b/clang/test/CodeGenHLSL/ArrayAssignable.hlsl
index c3204570d6ef3..aaa486eff10b7 100644
--- a/clang/test/CodeGenHLSL/ArrayAssignable.hlsl
+++ b/clang/test/CodeGenHLSL/ArrayAssignable.hlsl
@@ -7,10 +7,10 @@ struct S {
 
 // CHECK: [[CBLayout:%.*]] = type <{ [2 x float], [2 x <4 x i32>], [2 x [2 x i32]], [1 x target("dx.Layout", %S, 8, 0, 4)] }>
 // CHECK: @CBArrays.cb = global target("dx.CBuffer", target("dx.Layout", [[CBLayout]], 136, 0, 32, 64, 128))
-// CHECK: @c1 = external addrspace(2) global [2 x float], align 4
-// CHECK: @c2 = external addrspace(2) global [2 x <4 x i32>], align 16
-// CHECK: @c3 = external addrspace(2) global [2 x [2 x i32]], align 4
-// CHECK: @c4 = external addrspace(2) global [1 x target("dx.Layout", %S, 8, 0, 4)], align 1
+// CHECK: @c1 = external hidden addrspace(2) global [2 x float], align 4
+// CHECK: @c2 = external hidden addrspace(2) global [2 x <4 x i32>], align 16
+// CHECK: @c3 = external hidden addrspace(2) global [2 x [2 x i32]], align 4
+// CHECK: @c4 = external hidden addrspace(2) global [1 x target("dx.Layout", %S, 8, 0, 4)], align 1
 
 cbuffer CBArrays : register(b0) {
   float c1[2];
@@ -19,7 +19,7 @@ cbuffer CBArrays : register(b0) {
   S c4[1];
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign1
+// CHECK-LABEL: define hidden void {{.*}}arr_assign1
 // CHECK: [[Arr:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr2:%.*]] = alloca [2 x i32], align 4
 // CHECK-NOT: alloca
@@ -33,7 +33,7 @@ void arr_assign1() {
   Arr = Arr2;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign2
+// CHECK-LABEL: define hidden void {{.*}}arr_assign2
 // CHECK: [[Arr:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr2:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr3:%.*]] = alloca [2 x i32], align 4
@@ -51,7 +51,7 @@ void arr_assign2() {
   Arr = Arr2 = Arr3;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign3
+// CHECK-LABEL: define hidden void {{.*}}arr_assign3
 // CHECK: [[Arr3:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NEXT: [[Arr4:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NOT: alloca
@@ -65,7 +65,7 @@ void arr_assign3() {
   Arr2 = Arr3;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign4
+// CHECK-LABEL: define hidden void {{.*}}arr_assign4
 // CHECK: [[Arr:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr2:%.*]] = alloca [2 x i32], align 4
 // CHECK-NOT: alloca
@@ -81,7 +81,7 @@ void arr_assign4() {
   (Arr = Arr2)[0] = 6;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign5
+// CHECK-LABEL: define hidden void {{.*}}arr_assign5
 // CHECK: [[Arr:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr2:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Arr3:%.*]] = alloca [2 x i32], align 4
@@ -101,7 +101,7 @@ void arr_assign5() {
   (Arr = Arr2 = Arr3)[0] = 6;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign6
+// CHECK-LABEL: define hidden void {{.*}}arr_assign6
 // CHECK: [[Arr3:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NEXT: [[Arr4:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NOT: alloca
@@ -118,7 +118,7 @@ void arr_assign6() {
   (Arr = Arr2)[0][0] = 6;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign7
+// CHECK-LABEL: define hidden void {{.*}}arr_assign7
 // CHECK: [[Arr:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NEXT: [[Arr2:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NOT: alloca
@@ -138,7 +138,7 @@ void arr_assign7() {
 
 // Verify you can assign from a cbuffer array
 
-// CHECK-LABEL: define void {{.*}}arr_assign8
+// CHECK-LABEL: define hidden void {{.*}}arr_assign8
 // CHECK: [[C:%.*]] = alloca [2 x float], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[C]], ptr align 4 {{.*}}, i32 8, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p2.i32(ptr align 4 [[C]], ptr addrspace(2) align 4 @c1, i32 8, i1 false)
@@ -148,7 +148,7 @@ void arr_assign8() {
   C = c1;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign9
+// CHECK-LABEL: define hidden void {{.*}}arr_assign9
 // CHECK: [[C:%.*]] = alloca [2 x <4 x i32>], align 16
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 16 [[C]], ptr align 16 {{.*}}, i32 32, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p2.i32(ptr align 16 [[C]], ptr addrspace(2) align 16 @c2, i32 32, i1 false)
@@ -158,7 +158,7 @@ void arr_assign9() {
   C = c2;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign10
+// CHECK-LABEL: define hidden void {{.*}}arr_assign10
 // CHECK: [[C:%.*]] = alloca [2 x [2 x i32]], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[C]], ptr align 4 {{.*}}, i32 16, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p2.i32(ptr align 4 [[C]], ptr addrspace(2) align 4 @c3, i32 16, i1 false)
@@ -168,7 +168,7 @@ void arr_assign10() {
   C = c3;
 }
 
-// CHECK-LABEL: define void {{.*}}arr_assign11
+// CHECK-LABEL: define hidden void {{.*}}arr_assign11
 // CHECK: [[C:%.*]] = alloca [1 x %struct.S], align 1
 // CHECK: call void @llvm.memcpy.p0.p2.i32(ptr align 1 [[C]], ptr addrspace(2) align 1 @c4, i32 8, i1 false)
 // CHECK-NEXT: ret void
diff --git a/clang/test/CodeGenHLSL/ArrayTemporary.hlsl b/clang/test/CodeGenHLSL/ArrayTemporary.hlsl
index 29ea896045bb1..42a469ae87957 100644
--- a/clang/test/CodeGenHLSL/ArrayTemporary.hlsl
+++ b/clang/test/CodeGenHLSL/ArrayTemporary.hlsl
@@ -3,7 +3,7 @@
 
 void fn(float x[2]) { }
 
-// CHECK-LABEL: define void {{.*}}call{{.*}}
+// CHECK-LABEL: define hidden void {{.*}}call{{.*}}
 // CHECK: [[Arr:%.*]] = alloca [2 x float]
 // CHECK: [[Tmp:%.*]] = alloca [2 x float]
 // CHECK: call void @llvm.memset.p0.i32(ptr align 4 [[Arr]], i8 0, i32 8, i1 false)
@@ -21,7 +21,7 @@ struct Obj {
 
 void fn2(Obj O[4]) { }
 
-// CHECK-LABEL: define void {{.*}}call2{{.*}}
+// CHECK-LABEL: define hidden void {{.*}}call2{{.*}}
 // CHECK: [[Arr:%.*]] = alloca [4 x %struct.Obj]
 // CHECK: [[Tmp:%.*]] = alloca [4 x %struct.Obj]
 // CHECK: call void @llvm.memset.p0.i32(ptr align 1 [[Arr]], i8 0, i32 32, i1 false)
@@ -35,7 +35,7 @@ void call2() {
 
 void fn3(float x[2][2]) { }
 
-// CHECK-LABEL: define void {{.*}}call3{{.*}}
+// CHECK-LABEL: define hidden void {{.*}}call3{{.*}}
 // CHECK: [[Arr:%.*]] = alloca [2 x [2 x float]]
 // CHECK: [[Tmp:%.*]] = alloca [2 x [2 x float]]
 // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Arr]], ptr align 4 {{.*}}, i32 16, i1 false)
@@ -46,7 +46,7 @@ void call3() {
   fn3(Arr);
 }
 
-// CHECK-LABEL: define void {{.*}}call4{{.*}}(ptr
+// CHECK-LABEL: define hidden void {{.*}}call4{{.*}}(ptr
 // CHECK-SAME: noundef byval([2 x [2 x float]]) align 4 [[Arr:%.*]])
 // CHECK: [[Tmp:%.*]] = alloca [2 x [2 x float]]
 // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 [[Arr]], i32 16, i1 false)
@@ -59,7 +59,7 @@ void call4(float Arr[2][2]) {
 // Verify that each template instantiation codegens to a unique and correctly
 // mangled function name.
 
-// CHECK-LABEL: define void {{.*}}template_call{{.*}}(ptr
+// CHECK-LABEL: define hidden void {{.*}}template_call{{.*}}(ptr
 
 // CHECK-SAME: noundef byval([2 x float]) align 4 [[FA2:%[0-9A-Z]+]],
 // CHECK-SAME: ptr noundef byval([4 x float]) align 4 [[FA4:%[0-9A-Z]+]],
@@ -86,7 +86,7 @@ void template_call(float FA2[2], float FA4[4], int IA3[3]) {
 
 
 // Verify that Array parameter element access correctly codegens.
-// CHECK-LABEL: define void {{.*}}element_access{{.*}}(ptr
+// CHECK-LABEL: define hidden void {{.*}}element_access{{.*}}(ptr
 // CHECK-SAME: noundef byval([2 x float]) align 4 [[FA2:%[0-9A-Z]+]]
 
 // CHECK: [[Addr:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 0
diff --git a/clang/test/CodeGenHLSL/BasicFeatures/ArrayOutputArguments.hlsl b/clang/test/CodeGenHLSL/BasicFeatures/ArrayOutputArguments.hlsl
index eb7d755bca61d..bccfaf597f0ed 100644
--- a/clang/test/CodeGenHLSL/BasicFeatures/ArrayOutputArguments.hlsl
+++ b/clang/test/CodeGenHLSL/BasicFeatures/ArrayOutputArguments.hlsl
@@ -11,7 +11,7 @@ void increment(inout int Arr[2]) {
 // CHECK-NEXT: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 @{{.*}}, i32 8, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 [[A]], i32 8, i1 false)
-// CHECK-NEXT: call void @{{.*}}increment{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void @{{.*}}increment{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: [[Idx:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i32 0, i32 0
 // CHECK-NEXT: [[B:%.*]] = load i32, ptr [[Idx]], align 4
@@ -32,7 +32,7 @@ void fn2(out int Arr[2]) {
 // CHECK: [[A:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 @{{.*}}, i32 8, i1 false)
-// CHECK-NEXT: call void @{{.*}}fn2{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void @{{.*}}fn2{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: [[Idx:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i32 0, i32 0
 // CHECK-NEXT: [[B:%.*]] = load i32, ptr [[Idx]], align 4
@@ -56,7 +56,7 @@ void nestedCall(inout int Arr[2], uint index) {
 // CHECK-NEXT: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 @{{.*}}, i32 8, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 [[A]], i32 8, i1 false)
-// CHECK-NEXT: call void @{{.*}}nestedCall{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]], i32 noundef 0) #3
+// CHECK-NEXT: call void @{{.*}}nestedCall{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]], i32 noundef 0)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: [[Idx:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i32 0, i32 1
 // CHECK-NEXT: [[B:%.*]] = load i32, ptr [[Idx]], align 4
@@ -70,7 +70,7 @@ export int arrayCall3() {
 // CHECK-LABEL: outerCall
 // CHECK: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 %{{.*}}, i32 8, i1 false)
-// CHECK-NEXT: call void {{.*}}increment{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void {{.*}}increment{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 {{.*}}, ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: ret void
 void outerCall(inout int Arr[2]) {
@@ -82,7 +82,7 @@ void outerCall(inout int Arr[2]) {
 // CHECK-NEXT: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 @{{.*}}, i32 8, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 [[A]], i32 8, i1 false)
-// CHECK-NEXT: call void @{{.*}}outerCall{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void @{{.*}}outerCall{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: [[Idx:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i32 0, i32 0
 // CHECK-NEXT: [[B:%.*]] = load i32, ptr [[Idx]], align 4
@@ -99,7 +99,7 @@ void fn3(int Arr[2]) {}
 // CHECK-LABEL: outerCall2
 // CHECK: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 {{.*}}, i32 8, i1 false)
-// CHECK-NEXT: call void {{.*}}fn3{{.*}}(ptr noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void {{.*}}fn3{{.*}}(ptr noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: ret void
 void outerCall2(inout int Arr[2]) {
   fn3(Arr);
@@ -110,7 +110,7 @@ void outerCall2(inout int Arr[2]) {
 // CHECK-NEXT: [[Tmp:%.*]] = alloca [2 x i32], align 4
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 @{{.*}}, i32 8, i1 false)
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[Tmp]], ptr align 4 [[A]], i32 8, i1 false)
-// CHECK-NEXT: call void @{{.*}}outerCall2{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]]) #3
+// CHECK-NEXT: call void @{{.*}}outerCall2{{.*}}(ptr noalias noundef byval([2 x i32]) align 4 [[Tmp]])
 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[A]], ptr align 4 [[Tmp]], i32 8, i1 false)
 // CHECK-NEXT: [[Idx:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i32 0, i32 0
 // CHECK-NEXT: [[B:%.*]] = load i32, ptr [[Idx]], align 4
diff --git a/clang/test/CodeGenHLSL/BasicFeatures/InitLists.hlsl b/clang/test/CodeGenHLSL/BasicFeatures/InitLists.hlsl
index 371f31c9e4afc..c30c640519cda 100644
--- a/clang/test/CodeGenHLSL/BasicFeatures/InitLists.hlsl
+++ b/clang/test/CodeGenHLSL/BasicFeatures/InitLists.hlsl
@@ -46,7 +46,7 @@ struct SlicyBits {
 };
 
 // Case 1: Extraneous braces get ignored in literal instantiation.
-// CHECK-LABEL: define void @_Z5case1v(
+// CHECK-LABEL: define hidden void @_Z5case1v(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOFLOATS:%.*]]) align 1 [[AGG_RESULT:%.*]]) #[[ATTR0:[0-9]+]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    call void @llvm.memcpy.p0.p0.i32(ptr align 1 [[AGG_RESULT]], ptr align 1 @__const._Z5case1v.TF1, i32 8, i1 false)
@@ -58,7 +58,7 @@ TwoFloats case1() {
 }
 
 // Case 2: Valid C/C++ initializer is handled appropriately.
-// CHECK-LABEL: define void @_Z5case2v(
+// CHECK-LABEL: define hidden void @_Z5case2v(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOFLOATS:%.*]]) align 1 [[AGG_RESULT:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    call void @llvm.memcpy.p0.p0.i32(ptr align 1 [[AGG_RESULT]], ptr align 1 @__const._Z5case2v.TF2, i32 8, i1 false)
@@ -70,7 +70,7 @@ TwoFloats case2() {
 }
 
 // Case 3: Simple initialization with conversion of an argument.
-// CHECK-LABEL: define void @_Z5case3i(
+// CHECK-LABEL: define hidden void @_Z5case3i(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOFLOATS:%.*]]) align 1 [[AGG_RESULT:%.*]], i32 noundef [[VAL:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[VAL_ADDR:%.*]] = alloca i32, align 4
@@ -90,7 +90,7 @@ TwoFloats case3(int Val) {
 
 // Case 4: Initialization from a scalarized vector into a structure with element
 // conversions.
-// CHECK-LABEL: define void @_Z5case4Dv2_i(
+// CHECK-LABEL: define hidden void @_Z5case4Dv2_i(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOFLOATS:%.*]]) align 1 [[AGG_RESULT:%.*]], <2 x i32> noundef [[TWOVALS:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[TWOVALS_ADDR:%.*]] = alloca <2 x i32>, align 8
@@ -113,7 +113,7 @@ TwoFloats case4(int2 TwoVals) {
 }
 
 // Case 5: Initialization from a scalarized vector of matching type.
-// CHECK-LABEL: define void @_Z5case5Dv2_i(
+// CHECK-LABEL: define hidden void @_Z5case5Dv2_i(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOINTS:%.*]]) align 1 [[AGG_RESULT:%.*]], <2 x i32> noundef [[TWOVALS:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[TWOVALS_ADDR:%.*]] = alloca <2 x i32>, align 8
@@ -135,7 +135,7 @@ TwoInts case5(int2 TwoVals) {
 
 // Case 6: Initialization from a scalarized structure of different type with
 // different element types.
-// CHECK-LABEL: define void @_Z5case69TwoFloats(
+// CHECK-LABEL: define hidden void @_Z5case69TwoFloats(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_TWOINTS:%.*]]) align 1 [[AGG_RESULT:%.*]], ptr noundef byval([[STRUCT_TWOFLOATS:%.*]]) align 1 [[TF4:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[Z:%.*]] = getelementptr inbounds nuw [[STRUCT_TWOINTS]], ptr [[AGG_RESULT]], i32 0, i32 0
@@ -157,7 +157,7 @@ TwoInts case6(TwoFloats TF4) {
 
 // Case 7: Initialization of a complex structure, with bogus braces and element
 // conversions from a collection of scalar values, and structures.
-// CHECK-LABEL: define void @_Z5case77TwoIntsS_i9TwoFloatsS0_S0_S0_(
+// CHECK-LABEL: define hidden void @_Z5case77TwoIntsS_i9TwoFloatsS0_S0_S0_(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_DOGGO:%.*]]) align 1 [[AGG_RESULT:%.*]], ptr noundef byval([[STRUCT_TWOINTS:%.*]]) align 1 [[TI1:%.*]], ptr noundef byval([[STRUCT_TWOINTS]]) align 1 [[TI2:%.*]], i32 noundef [[VAL:%.*]], ptr noundef byval([[STRUCT_TWOFLOATS:%.*]]) align 1 [[TF1:%.*]], ptr noundef byval([[STRUCT_TWOFLOATS]]) align 1 [[TF2:%.*]], ptr noundef byval([[STRUCT_TWOFLOATS]]) align 1 [[TF3:%.*]], ptr noundef byval([[STRUCT_TWOFLOATS]]) align 1 [[TF4:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[VAL_ADDR:%.*]] = alloca i32, align 4
@@ -221,7 +221,7 @@ Doggo case7(TwoInts TI1, TwoInts TI2, int Val, TwoFloats TF1, TwoFloats TF2,
 
 // Case 8: Initialization of a structure from a different structure with
 // significantly different element types and grouping.
-// CHECK-LABEL: define void @_Z5case85Doggo(
+// CHECK-LABEL: define hidden void @_Z5case85Doggo(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_ANIMALBITS:%.*]]) align 1 [[AGG_RESULT:%.*]], ptr noundef byval([[STRUCT_DOGGO:%.*]]) align 1 [[D1:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[LEGS:%.*]] = getelementptr inbounds nuw [[STRUCT_ANIMALBITS]], ptr [[AGG_RESULT]], i32 0, i32 0
@@ -307,7 +307,7 @@ AnimalBits case8(Doggo D1) {
 // Case 9: Everything everywhere all at once... Initializing mismatched
 // structures from different layouts, different component groupings, with no
 // top-level bracing separation.
-// CHECK-LABEL: define void @_Z5case95Doggo10AnimalBits(
+// CHECK-LABEL: define hidden void @_Z5case95Doggo10AnimalBits(
 // CHECK-SAME: ptr dead_on_unwind noalias writable sret([[STRUCT_ZOO:%.*]]) align 1 [[AGG_RESULT:%.*]], ptr noundef byval([[STRUCT_DOGGO:%.*]]) align 1 [[D1:%.*]], ptr noundef byval([[STRUCT_ANIMALBITS:%.*]]) align 1 [[A1:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    [[DOGS:%.*]] = getelementptr inbounds nuw [[STRUCT_ZOO]], ptr [[AGG_RESULT]], i32 0, i32 0
@@ -723,7 +723,7 @@ Zoo case9(Dog...
[truncated]

@@ -1661,6 +1661,11 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
return;
}

if (Context.getLangOpts().HLSL && !D->isInExportDeclContext()) {
GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GV at line 379 should also be updated, as well as the one for HLSLBufferDecl no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look into this for a follow up PR if necessary. This change affects many tests, and I don't want it to go stale.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what code you are referring it? Like 379 in this file does not have to do with global variables. As for the HLSLBufferDecl, I'll look into some examples tomorrow. I don't think it will be a problem though. The buffers decls for cbuffer require special handling that is not implemented for Spir-v yet. I think it is still unclear how that should be handled.

@s-perron s-perron merged commit a027eb4 into llvm:main Jun 16, 2025
7 of 9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 16, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-msan running on sanitizer-buildbot10 while building clang,llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/94/builds/8106

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[4685/5538] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CommonBugCategories.cpp.o
[4686/5538] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BlockCounter.cpp.o
[4687/5538] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[4688/5538] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/PrecompiledPreamble.cpp.o
[4689/5538] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
[4690/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DirectoryScanner.cpp.o
[4691/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Library.cpp.o
[4692/5538] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTReaderStmt.cpp.o
[4693/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[4694/5538] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o
FAILED: tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o 
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -MF tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o.d -o tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -c /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -MF tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o.d -o tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -c /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp
1.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:56:27: current parser token ';'
2.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:16:1: parsing namespace 'clang'
3.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:21:1: parsing struct/union/class body 'clang::DiagnosticError'
4.	/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include/c++/13/bits/stl_pair.h:187:12: instantiating class definition 'std::pair<clang::SourceLocation, clang::PartialDiagnostic>'
 #0 0x0000ab0b35695ab4 ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000ab0b3c0dd6e4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:808:7
 #2 0x0000ab0b3c0d8208 llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #3 0x0000ab0b3bf57d8c HandleCrash /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
 #4 0x0000ab0b3bf57d8c CrashRecoverySignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
 #5 0x0000ab0b356c7d08 ~ScopedThreadLocalStateBackup /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.h:352:37
 #6 0x0000ab0b356c7d08 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1124:1
 #7 0x0000f0000fa998f8 (linux-vdso.so.1+0x8f8)
 #8 0x0000f0000f4e2f7c (/lib/aarch64-linux-gnu/libc.so.6+0xa2f7c)
 #9 0x0000ab0b3566b3a4 MsanAllocate(__sanitizer::BufferedStackTrace*, unsigned long, unsigned long, bool) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp:227:9
#10 0x0000ab0b3566bbe4 SetErrnoOnNull /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_allocator_checks.h:31:7
#11 0x0000ab0b3566bbe4 __msan::msan_memalign(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp:398:10
#12 0x0000ab0b356d5d34 operator new(unsigned long, std::align_val_t, std::nothrow_t const&) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_new_delete.cpp:70:3
#13 0x0000ab0b3bfbcca8 llvm::allocate_buffer(unsigned long, unsigned long) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/MemAlloc.cpp:21:14
#14 0x0000ab0b3579df9c capacity /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:80:36
#15 0x0000ab0b3579df9c reserveForParamAndGetAddressImpl<llvm::SmallVectorTemplateBase<void *, true> > /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:233:9
#16 0x0000ab0b3579df9c reserveForParamAndGetAddress /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:538:9
#17 0x0000ab0b3579df9c push_back /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:563:23
#18 0x0000ab0b3579df9c StartNewSlab /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:353:11
#19 0x0000ab0b3579df9c llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::AllocateSlow(unsigned long, unsigned long, llvm::Align) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:203:5
#20 0x0000ab0b42dab420 Allocate /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:179:12
#21 0x0000ab0b42dab420 Allocate /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:217:12
#22 0x0000ab0b42dab420 clang::ASTContext::CreateTypeSourceInfo(clang::QualType, unsigned int) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/AST/ASTContext.cpp:3191:32
#23 0x0000ab0b42772a54 getTypeSourceInfo /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TypeLocBuilder.h:117:47
#24 0x0000ab0b42772a54 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5187:14
#25 0x0000ab0b4278550c TransformTemplateArgument /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:4914:9
#26 0x0000ab0b4278550c (anonymous namespace)::TemplateInstantiator::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1700:25
#27 0x0000ab0b427d1600 TransformTemplateArguments<clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc> > /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5138:22
#28 0x0000ab0b427d1600 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:7394:20
#29 0x0000ab0b427d01d4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTSIInObjectScope(clang::TypeLoc, clang::QualType, clang::NamedDecl*, clang::CXXScopeSpec&) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5425:3
Step 13 (build stage3/msan build) failure: build stage3/msan build (failure)
...
[4685/5538] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CommonBugCategories.cpp.o
[4686/5538] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BlockCounter.cpp.o
[4687/5538] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[4688/5538] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/PrecompiledPreamble.cpp.o
[4689/5538] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
[4690/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DirectoryScanner.cpp.o
[4691/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Library.cpp.o
[4692/5538] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTReaderStmt.cpp.o
[4693/5538] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[4694/5538] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o
FAILED: tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o 
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -MF tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o.d -o tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -c /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/tools/clang/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build2_msan/include -I/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -MF tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o.d -o tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o -c /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp
1.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:56:27: current parser token ';'
2.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:16:1: parsing namespace 'clang'
3.	/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Basic/DiagnosticError.h:21:1: parsing struct/union/class body 'clang::DiagnosticError'
4.	/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include/c++/13/bits/stl_pair.h:187:12: instantiating class definition 'std::pair<clang::SourceLocation, clang::PartialDiagnostic>'
 #0 0x0000ab0b35695ab4 ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000ab0b3c0dd6e4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:808:7
 #2 0x0000ab0b3c0d8208 llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #3 0x0000ab0b3bf57d8c HandleCrash /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
 #4 0x0000ab0b3bf57d8c CrashRecoverySignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
 #5 0x0000ab0b356c7d08 ~ScopedThreadLocalStateBackup /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.h:352:37
 #6 0x0000ab0b356c7d08 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1124:1
 #7 0x0000f0000fa998f8 (linux-vdso.so.1+0x8f8)
 #8 0x0000f0000f4e2f7c (/lib/aarch64-linux-gnu/libc.so.6+0xa2f7c)
 #9 0x0000ab0b3566b3a4 MsanAllocate(__sanitizer::BufferedStackTrace*, unsigned long, unsigned long, bool) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp:227:9
#10 0x0000ab0b3566bbe4 SetErrnoOnNull /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_allocator_checks.h:31:7
#11 0x0000ab0b3566bbe4 __msan::msan_memalign(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_allocator.cpp:398:10
#12 0x0000ab0b356d5d34 operator new(unsigned long, std::align_val_t, std::nothrow_t const&) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_new_delete.cpp:70:3
#13 0x0000ab0b3bfbcca8 llvm::allocate_buffer(unsigned long, unsigned long) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/MemAlloc.cpp:21:14
#14 0x0000ab0b3579df9c capacity /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:80:36
#15 0x0000ab0b3579df9c reserveForParamAndGetAddressImpl<llvm::SmallVectorTemplateBase<void *, true> > /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:233:9
#16 0x0000ab0b3579df9c reserveForParamAndGetAddress /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:538:9
#17 0x0000ab0b3579df9c push_back /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:563:23
#18 0x0000ab0b3579df9c StartNewSlab /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:353:11
#19 0x0000ab0b3579df9c llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::AllocateSlow(unsigned long, unsigned long, llvm::Align) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:203:5
#20 0x0000ab0b42dab420 Allocate /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:179:12
#21 0x0000ab0b42dab420 Allocate /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:217:12
#22 0x0000ab0b42dab420 clang::ASTContext::CreateTypeSourceInfo(clang::QualType, unsigned int) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/AST/ASTContext.cpp:3191:32
#23 0x0000ab0b42772a54 getTypeSourceInfo /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TypeLocBuilder.h:117:47
#24 0x0000ab0b42772a54 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5187:14
#25 0x0000ab0b4278550c TransformTemplateArgument /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:4914:9
#26 0x0000ab0b4278550c (anonymous namespace)::TemplateInstantiator::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1700:25
#27 0x0000ab0b427d1600 TransformTemplateArguments<clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc> > /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5138:22
#28 0x0000ab0b427d1600 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:7394:20
#29 0x0000ab0b427d01d4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTSIInObjectScope(clang::TypeLoc, clang::QualType, clang::NamedDecl*, clang::CXXScopeSpec&) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/TreeTransform.h:5425:3

fschlimb pushed a commit to fschlimb/llvm-project that referenced this pull request Jun 18, 2025
Implements

https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md.

The change is to stop using the `hlsl.export` attribute. Instead,
symbols with "program linkage" in HLSL will have export linkage with
default visibility, and symbols with "external linkage" in HLSL will
have export linkage with hidden visibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:DirectX backend:SPIR-V clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category HLSL HLSL Language Support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants