Skip to content

Commit 9e18ebb

Browse files
committed
fix formatting
1 parent 26980a2 commit 9e18ebb

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

clang/lib/AST/TypePrinter.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ static void printDims(const ConstantMatrixType *T, raw_ostream &OS) {
850850
OS << T->getNumRows() << ", " << T->getNumColumns();
851851
}
852852

853-
static void printHLSLMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T, raw_ostream &OS) {
853+
static void printHLSLMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T,
854+
raw_ostream &OS) {
854855
OS << "matrix<";
855856
TP.printBefore(T->getElementType(), OS);
856857
}
@@ -861,22 +862,25 @@ static void printHLSLMatrixAfter(const ConstantMatrixType *T, raw_ostream &OS) {
861862
OS << ">";
862863
}
863864

864-
static void printClangMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T, raw_ostream &OS) {
865+
static void printClangMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T,
866+
raw_ostream &OS) {
865867
TP.printBefore(T->getElementType(), OS);
866868
OS << " __attribute__((matrix_type(";
867869
printDims(T, OS);
868870
OS << ")))";
869871
}
870872

871-
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T, raw_ostream &OS) {
873+
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
874+
raw_ostream &OS) {
872875
if (Policy.UseHLSLTypes) {
873876
printHLSLMatrixBefore(*this, T, OS);
874877
return;
875878
}
876879
printClangMatrixBefore(*this, T, OS);
877880
}
878881

879-
void TypePrinter::printConstantMatrixAfter(const ConstantMatrixType *T, raw_ostream &OS) {
882+
void TypePrinter::printConstantMatrixAfter(const ConstantMatrixType *T,
883+
raw_ostream &OS) {
880884
if (Policy.UseHLSLTypes) {
881885
printHLSLMatrixAfter(T, OS);
882886
return;

clang/lib/Headers/hlsl/hlsl_basic_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ typedef vector<float64_t, 2> float64_t2;
115115
typedef vector<float64_t, 3> float64_t3;
116116
typedef vector<float64_t, 4> float64_t4;
117117

118-
ifdef __HLSL_ENABLE_16_BIT
118+
#ifdef __HLSL_ENABLE_16_BIT
119119
typedef matrix<int16_t, 1, 1> int16_t1x1;
120120
typedef matrix<int16_t, 1, 2> int16_t1x2;
121121
typedef matrix<int16_t, 1, 3> int16_t1x3;

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void HLSLExternalSemaSource::defineHLSLVectorAlias() {
123123

124124
void HLSLExternalSemaSource::defineHLSLMatrixAlias() {
125125
ASTContext &AST = SemaPtr->getASTContext();
126-
llvm::SmallVector<NamedDecl *> TemplateParams;
126+
llvm::SmallVector<NamedDecl *> TemplateParams;
127127

128128
auto *TypeParam = TemplateTypeParmDecl::Create(
129129
AST, HLSLNamespace, SourceLocation(), SourceLocation(), 0, 0,
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
2-
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify
1+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
32

43
uint64_t5x5 mat;
54
// expected-error@-1 {{unknown type name 'uint64_t5x5'}}
5+
6+
// Note: this one only fails because -fnative-half-type is not set
7+
uint16_t4x4 mat;
8+
// expected-error@-1 {{unknown type name 'uint16_t4x4'}}

0 commit comments

Comments
 (0)