Skip to content

Commit 58d2475

Browse files
authored
[HLSL][NFC] Change line endings to LF (#156930)
Changes line endings in files related to HLSL to LF (`\n`).
1 parent 1dbe65a commit 58d2475

File tree

92 files changed

+5473
-5473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+5473
-5473
lines changed

clang/lib/CodeGen/HLSLBufferLayoutBuilder.cpp

Lines changed: 273 additions & 273 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
//===- HLSLBufferLayoutBuilder.h ------------------------------------------===//
2-
//
3-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4-
// See https://llvm.org/LICENSE.txt for license information.
5-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
//
7-
//===----------------------------------------------------------------------===//
8-
9-
#include "llvm/ADT/StringRef.h"
10-
#include "llvm/IR/DerivedTypes.h"
11-
12-
namespace clang {
13-
class RecordType;
14-
class FieldDecl;
15-
16-
namespace CodeGen {
17-
class CodeGenModule;
18-
19-
//===----------------------------------------------------------------------===//
20-
// Implementation of constant buffer layout common between DirectX and
21-
// SPIR/SPIR-V.
22-
//===----------------------------------------------------------------------===//
23-
24-
class HLSLBufferLayoutBuilder {
25-
private:
26-
CodeGenModule &CGM;
27-
llvm::StringRef LayoutTypeName;
28-
29-
public:
30-
HLSLBufferLayoutBuilder(CodeGenModule &CGM, llvm::StringRef LayoutTypeName)
31-
: CGM(CGM), LayoutTypeName(LayoutTypeName) {}
32-
33-
// Returns LLVM target extension type with the name LayoutTypeName
34-
// for given structure type and layout data. The first number in
35-
// the Layout is the size followed by offsets for each struct element.
36-
llvm::TargetExtType *
37-
createLayoutType(const RecordType *StructType,
38-
const llvm::SmallVector<int32_t> *Packoffsets = nullptr);
39-
40-
private:
41-
bool layoutField(const clang::FieldDecl *FD, unsigned &EndOffset,
42-
unsigned &FieldOffset, llvm::Type *&FieldType,
43-
int Packoffset = -1);
44-
};
45-
46-
} // namespace CodeGen
47-
} // namespace clang
1+
//===- HLSLBufferLayoutBuilder.h ------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "llvm/ADT/StringRef.h"
10+
#include "llvm/IR/DerivedTypes.h"
11+
12+
namespace clang {
13+
class RecordType;
14+
class FieldDecl;
15+
16+
namespace CodeGen {
17+
class CodeGenModule;
18+
19+
//===----------------------------------------------------------------------===//
20+
// Implementation of constant buffer layout common between DirectX and
21+
// SPIR/SPIR-V.
22+
//===----------------------------------------------------------------------===//
23+
24+
class HLSLBufferLayoutBuilder {
25+
private:
26+
CodeGenModule &CGM;
27+
llvm::StringRef LayoutTypeName;
28+
29+
public:
30+
HLSLBufferLayoutBuilder(CodeGenModule &CGM, llvm::StringRef LayoutTypeName)
31+
: CGM(CGM), LayoutTypeName(LayoutTypeName) {}
32+
33+
// Returns LLVM target extension type with the name LayoutTypeName
34+
// for given structure type and layout data. The first number in
35+
// the Layout is the size followed by offsets for each struct element.
36+
llvm::TargetExtType *
37+
createLayoutType(const RecordType *StructType,
38+
const llvm::SmallVector<int32_t> *Packoffsets = nullptr);
39+
40+
private:
41+
bool layoutField(const clang::FieldDecl *FD, unsigned &EndOffset,
42+
unsigned &FieldOffset, llvm::Type *&FieldType,
43+
int Packoffset = -1);
44+
};
45+
46+
} // namespace CodeGen
47+
} // namespace clang
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -ast-dump-filter=__is_structured_resource_element_compatible %s | FileCheck %s
2-
3-
// CHECK: ConceptDecl {{.*}} __is_structured_resource_element_compatible
4-
// CHECK: |-TemplateTypeParmDecl {{.*}} referenced typename depth 0 index 0 element_type
5-
// CHECK: `-BinaryOperator {{.*}} 'bool' lvalue '&&'
6-
// CHECK: |-UnaryOperator {{.*}} 'bool' lvalue prefix '!' cannot overflow
7-
// CHECK: | `-TypeTraitExpr {{.*}} 'bool' __builtin_hlsl_is_intangible
8-
// CHECK: | `-TemplateTypeParmType {{.*}} 'element_type' dependent depth 0 index 0
9-
// CHECK: | `-TemplateTypeParm {{.*}} 'element_type'
10-
// CHECK: `-BinaryOperator {{.*}} 'bool' lvalue '>='
11-
// CHECK: |-UnaryExprOrTypeTraitExpr {{.*}} 'bool' sizeof 'element_type'
12-
// CHECK: `-IntegerLiteral {{.*}} '__size_t':'unsigned long' 1
13-
14-
15-
StructuredBuffer<float> Buffer;
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -ast-dump-filter=__is_structured_resource_element_compatible %s | FileCheck %s
2+
3+
// CHECK: ConceptDecl {{.*}} __is_structured_resource_element_compatible
4+
// CHECK: |-TemplateTypeParmDecl {{.*}} referenced typename depth 0 index 0 element_type
5+
// CHECK: `-BinaryOperator {{.*}} 'bool' lvalue '&&'
6+
// CHECK: |-UnaryOperator {{.*}} 'bool' lvalue prefix '!' cannot overflow
7+
// CHECK: | `-TypeTraitExpr {{.*}} 'bool' __builtin_hlsl_is_intangible
8+
// CHECK: | `-TemplateTypeParmType {{.*}} 'element_type' dependent depth 0 index 0
9+
// CHECK: | `-TemplateTypeParm {{.*}} 'element_type'
10+
// CHECK: `-BinaryOperator {{.*}} 'bool' lvalue '>='
11+
// CHECK: |-UnaryExprOrTypeTraitExpr {{.*}} 'bool' sizeof 'element_type'
12+
// CHECK: `-IntegerLiteral {{.*}} '__size_t':'unsigned long' 1
13+
14+
15+
StructuredBuffer<float> Buffer;
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -ast-dump-filter=__is_typed_resource_element_compatible %s | FileCheck %s
2-
3-
// CHECK: ConceptDecl {{.*}} __is_typed_resource_element_compatible
4-
// CHECK: |-TemplateTypeParmDecl {{.*}} referenced typename depth 0 index 0 element_type
5-
// CHECK: `-TypeTraitExpr {{.*}} 'bool' __builtin_hlsl_is_typed_resource_element_compatible
6-
// CHECK: `-TemplateTypeParmType {{.*}} 'element_type' dependent depth 0 index 0
7-
// CHECK: `-TemplateTypeParm {{.*}} 'element_type'
8-
9-
RWBuffer<float> Buffer;
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -ast-dump-filter=__is_typed_resource_element_compatible %s | FileCheck %s
2+
3+
// CHECK: ConceptDecl {{.*}} __is_typed_resource_element_compatible
4+
// CHECK: |-TemplateTypeParmDecl {{.*}} referenced typename depth 0 index 0 element_type
5+
// CHECK: `-TypeTraitExpr {{.*}} 'bool' __builtin_hlsl_is_typed_resource_element_compatible
6+
// CHECK: `-TemplateTypeParmType {{.*}} 'element_type' dependent depth 0 index 0
7+
// CHECK: `-TemplateTypeParm {{.*}} 'element_type'
8+
9+
RWBuffer<float> Buffer;
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s
2-
3-
//CHECK-LABEL: define {{.*}}test_ints
4-
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
5-
//CHECK-NOT: bitcast
6-
//CHECK: entry:
7-
//CHECK-NEXT: ret i16 [[VAL]]
8-
int16_t test_int(int16_t p0)
9-
{
10-
return asint16(p0);
11-
}
12-
13-
//CHECK-LABEL: define {{.*}}test_uint
14-
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
15-
//CHECK-NOT:bitcast
16-
//CHECK: entry:
17-
//CHECK-NEXT: ret i16 [[VAL]]
18-
int16_t test_uint(uint16_t p0)
19-
{
20-
return asint16(p0);
21-
}
22-
23-
//CHECK-LABEL: define {{.*}}test_half
24-
//CHECK-SAME: {{.*}}(half {{.*}} [[VAL:%.*]]){{.*}}
25-
//CHECK: [[RES:%.*]] = bitcast half [[VAL]] to i16
26-
//CHECK-NEXT : ret i16 [[RES]]
27-
int16_t test_half(half p0)
28-
{
29-
return asint16(p0);
30-
}
31-
32-
//CHECK-LABEL: define {{.*}}test_vector_int
33-
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
34-
//CHECK-NOT: bitcast
35-
//CHECK: entry:
36-
//CHECK-NEXT: ret <4 x i16> [[VAL]]
37-
int16_t4 test_vector_int(int16_t4 p0)
38-
{
39-
return asint16(p0);
40-
}
41-
42-
//CHECK-LABEL: define {{.*}}test_vector_uint
43-
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
44-
//CHECK-NOT: bitcast
45-
//CHECK-NEXT: entry:
46-
//CHECK-NEXT: ret <4 x i16> [[VAL]]
47-
int16_t4 test_vector_uint(uint16_t4 p0)
48-
{
49-
return asint16(p0);
50-
}
51-
52-
//CHECK-LABEL: define {{.*}}fn
53-
//CHECK-SAME: {{.*}}(<4 x half> {{.*}} [[VAL:%.*]]){{.*}}
54-
//CHECK: [[RES:%.*]] = bitcast <4 x half> [[VAL]] to <4 x i16>
55-
//CHECK-NEXT: ret <4 x i16> [[RES]]
56-
int16_t4 fn(half4 p1)
57-
{
58-
return asint16(p1);
59-
}
60-
1+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s
2+
3+
//CHECK-LABEL: define {{.*}}test_ints
4+
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
5+
//CHECK-NOT: bitcast
6+
//CHECK: entry:
7+
//CHECK-NEXT: ret i16 [[VAL]]
8+
int16_t test_int(int16_t p0)
9+
{
10+
return asint16(p0);
11+
}
12+
13+
//CHECK-LABEL: define {{.*}}test_uint
14+
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
15+
//CHECK-NOT:bitcast
16+
//CHECK: entry:
17+
//CHECK-NEXT: ret i16 [[VAL]]
18+
int16_t test_uint(uint16_t p0)
19+
{
20+
return asint16(p0);
21+
}
22+
23+
//CHECK-LABEL: define {{.*}}test_half
24+
//CHECK-SAME: {{.*}}(half {{.*}} [[VAL:%.*]]){{.*}}
25+
//CHECK: [[RES:%.*]] = bitcast half [[VAL]] to i16
26+
//CHECK-NEXT : ret i16 [[RES]]
27+
int16_t test_half(half p0)
28+
{
29+
return asint16(p0);
30+
}
31+
32+
//CHECK-LABEL: define {{.*}}test_vector_int
33+
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
34+
//CHECK-NOT: bitcast
35+
//CHECK: entry:
36+
//CHECK-NEXT: ret <4 x i16> [[VAL]]
37+
int16_t4 test_vector_int(int16_t4 p0)
38+
{
39+
return asint16(p0);
40+
}
41+
42+
//CHECK-LABEL: define {{.*}}test_vector_uint
43+
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
44+
//CHECK-NOT: bitcast
45+
//CHECK-NEXT: entry:
46+
//CHECK-NEXT: ret <4 x i16> [[VAL]]
47+
int16_t4 test_vector_uint(uint16_t4 p0)
48+
{
49+
return asint16(p0);
50+
}
51+
52+
//CHECK-LABEL: define {{.*}}fn
53+
//CHECK-SAME: {{.*}}(<4 x half> {{.*}} [[VAL:%.*]]){{.*}}
54+
//CHECK: [[RES:%.*]] = bitcast <4 x half> [[VAL]] to <4 x i16>
55+
//CHECK-NEXT: ret <4 x i16> [[RES]]
56+
int16_t4 fn(half4 p1)
57+
{
58+
return asint16(p1);
59+
}
60+
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s
2-
3-
//CHECK-LABEL: define {{.*}}test_ints
4-
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
5-
//CHECK-NOT: bitcast
6-
//CHECK: entry:
7-
//CHECK: ret i16 [[VAL]]
8-
uint16_t test_int(int16_t p0)
9-
{
10-
return asuint16(p0);
11-
}
12-
13-
//CHECK-LABEL: define {{.*}}test_uint
14-
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
15-
//CHECK-NOT: bitcast
16-
//CHECK: entry:
17-
//CHECK-NEXT: ret i16 [[VAL]]
18-
uint16_t test_uint(uint16_t p0)
19-
{
20-
return asuint16(p0);
21-
}
22-
23-
//CHECK-LABEL: define {{.*}}test_half
24-
//CHECK-SAME: {{.*}}(half {{.*}} [[VAL:%.*]]){{.*}}
25-
//CHECK: [[RES:%.*]] = bitcast half [[VAL]] to i16
26-
//CHECK-NEXT: ret i16 [[RES]]
27-
uint16_t test_half(half p0)
28-
{
29-
return asuint16(p0);
30-
}
31-
32-
//CHECK-LABEL: define {{.*}}test_vector_int
33-
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
34-
//CHECK-NOT: bitcast
35-
//CHECK: entry:
36-
//CHECK-NEXT: ret <4 x i16> [[VAL]]
37-
uint16_t4 test_vector_int(int16_t4 p0)
38-
{
39-
return asuint16(p0);
40-
}
41-
42-
//CHECK-LABEL: define {{.*}}test_vector_uint
43-
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
44-
//CHECK-NOT: bitcast
45-
//CHECK: entry:
46-
//CHECK-NEXT: ret <4 x i16> [[VAL]]
47-
uint16_t4 test_vector_uint(uint16_t4 p0)
48-
{
49-
return asuint16(p0);
50-
}
51-
52-
//CHECK-LABEL: define {{.*}}fn
53-
//CHECK-SAME: {{.*}}(<4 x half> {{.*}} [[VAL:%.*]]){{.*}}
54-
//CHECK: [[RES:%.*]] = bitcast <4 x half> [[VAL]] to <4 x i16>
55-
//CHECK-NEXT: ret <4 x i16> [[RES]]
56-
uint16_t4 fn(half4 p1)
57-
{
58-
return asuint16(p1);
59-
}
60-
1+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s
2+
3+
//CHECK-LABEL: define {{.*}}test_ints
4+
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
5+
//CHECK-NOT: bitcast
6+
//CHECK: entry:
7+
//CHECK: ret i16 [[VAL]]
8+
uint16_t test_int(int16_t p0)
9+
{
10+
return asuint16(p0);
11+
}
12+
13+
//CHECK-LABEL: define {{.*}}test_uint
14+
//CHECK-SAME: {{.*}}(i16 {{.*}} [[VAL:%.*]]){{.*}}
15+
//CHECK-NOT: bitcast
16+
//CHECK: entry:
17+
//CHECK-NEXT: ret i16 [[VAL]]
18+
uint16_t test_uint(uint16_t p0)
19+
{
20+
return asuint16(p0);
21+
}
22+
23+
//CHECK-LABEL: define {{.*}}test_half
24+
//CHECK-SAME: {{.*}}(half {{.*}} [[VAL:%.*]]){{.*}}
25+
//CHECK: [[RES:%.*]] = bitcast half [[VAL]] to i16
26+
//CHECK-NEXT: ret i16 [[RES]]
27+
uint16_t test_half(half p0)
28+
{
29+
return asuint16(p0);
30+
}
31+
32+
//CHECK-LABEL: define {{.*}}test_vector_int
33+
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
34+
//CHECK-NOT: bitcast
35+
//CHECK: entry:
36+
//CHECK-NEXT: ret <4 x i16> [[VAL]]
37+
uint16_t4 test_vector_int(int16_t4 p0)
38+
{
39+
return asuint16(p0);
40+
}
41+
42+
//CHECK-LABEL: define {{.*}}test_vector_uint
43+
//CHECK-SAME: {{.*}}(<4 x i16> {{.*}} [[VAL:%.*]]){{.*}}
44+
//CHECK-NOT: bitcast
45+
//CHECK: entry:
46+
//CHECK-NEXT: ret <4 x i16> [[VAL]]
47+
uint16_t4 test_vector_uint(uint16_t4 p0)
48+
{
49+
return asuint16(p0);
50+
}
51+
52+
//CHECK-LABEL: define {{.*}}fn
53+
//CHECK-SAME: {{.*}}(<4 x half> {{.*}} [[VAL:%.*]]){{.*}}
54+
//CHECK: [[RES:%.*]] = bitcast <4 x half> [[VAL]] to <4 x i16>
55+
//CHECK-NEXT: ret <4 x i16> [[RES]]
56+
uint16_t4 fn(half4 p1)
57+
{
58+
return asuint16(p1);
59+
}
60+

0 commit comments

Comments
 (0)