Skip to content

Commit fb6538e

Browse files
committed
clang-format
1 parent 765ab1c commit fb6538e

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

tools/clang/include/clang/AST/HlslTypes.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ void AddHLSLNodeOutputRecordTemplate(
348348
_Outptr_ clang::ClassTemplateDecl **outputRecordTemplateDecl,
349349
bool isCompleteType = true);
350350

351-
clang::CXXRecordDecl *DeclareRecordTypeWithHandle(clang::ASTContext &context,
352-
llvm::StringRef name,
353-
bool isCompleteType = true,
354-
clang::InheritableAttr *Attr = nullptr);
351+
clang::CXXRecordDecl *
352+
DeclareRecordTypeWithHandle(clang::ASTContext &context, llvm::StringRef name,
353+
bool isCompleteType = true,
354+
clang::InheritableAttr *Attr = nullptr);
355355

356356
void AddRaytracingConstants(clang::ASTContext &context);
357357
void AddSamplerFeedbackConstants(clang::ASTContext &context);
@@ -382,8 +382,7 @@ clang::CXXRecordDecl *DeclareTemplateTypeWithHandleInDeclContext(
382382

383383
clang::CXXRecordDecl *DeclareUIntTemplatedTypeWithHandle(
384384
clang::ASTContext &context, llvm::StringRef typeName,
385-
llvm::StringRef templateParamName,
386-
clang::InheritableAttr *Attr = nullptr);
385+
llvm::StringRef templateParamName, clang::InheritableAttr *Attr = nullptr);
387386
clang::CXXRecordDecl *DeclareUIntTemplatedTypeWithHandleInDeclContext(
388387
clang::ASTContext &context, clang::DeclContext *declContext,
389388
llvm::StringRef typeName, llvm::StringRef templateParamName,

tools/clang/lib/AST/ASTContextHLSL.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ CXXRecordDecl *hlsl::DeclareUIntTemplatedTypeWithHandleInDeclContext(
11111111
ASTContext &context, DeclContext *declContext, StringRef typeName,
11121112
StringRef templateParamName, InheritableAttr *Attr) {
11131113
// template<uint kind> FeedbackTexture2D[Array] { ... }
1114-
BuiltinTypeDeclBuilder typeDeclBuilder(declContext, typeName, TagTypeKind::TTK_Class);
1114+
BuiltinTypeDeclBuilder typeDeclBuilder(declContext, typeName,
1115+
TagTypeKind::TTK_Class);
11151116
typeDeclBuilder.addIntegerTemplateParam(templateParamName,
11161117
context.UnsignedIntTy);
11171118
typeDeclBuilder.startDefinition();
@@ -1140,9 +1141,9 @@ hlsl::DeclareConstantBufferViewType(clang::ASTContext &context, bool bTBuf) {
11401141
typeDeclBuilder.addField(
11411142
"h", context.UnsignedIntTy); // Add an 'h' field to hold the handle.
11421143

1143-
typeDeclBuilder.getRecordDecl()->addAttr(
1144-
HLSLResourceAttr::CreateImplicit(context, (unsigned)DXIL::ResourceKind::CBuffer,
1145-
(unsigned)DXIL::ResourceClass::CBuffer));
1144+
typeDeclBuilder.getRecordDecl()->addAttr(HLSLResourceAttr::CreateImplicit(
1145+
context, (unsigned)DXIL::ResourceKind::CBuffer,
1146+
(unsigned)DXIL::ResourceClass::CBuffer));
11461147

11471148
typeDeclBuilder.getRecordDecl();
11481149

tools/clang/lib/AST/HlslTypes.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,7 @@ clang::QualType GetHLSLMatElementType(clang::QualType type) {
475475
return elemTy;
476476
}
477477

478-
479-
template<typename AttrType>
480-
static AttrType *getAttr(clang::QualType type) {
478+
template <typename AttrType> static AttrType *getAttr(clang::QualType type) {
481479
type = type.getCanonicalType();
482480
if (const RecordType *RT = type->getAs<RecordType>()) {
483481
if (const auto *Spec =

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ enum ArBasicKind {
363363

364364
#define IS_BPROP_STREAM(_Props) (((_Props)&BPROP_STREAM) != 0)
365365

366-
#define IS_BPROP_PATCH(_Props) (((_Props) & BPROP_PATCH) != 0)
366+
#define IS_BPROP_PATCH(_Props) (((_Props)&BPROP_PATCH) != 0)
367367

368368
#define IS_BPROP_SAMPLER(_Props) (((_Props)&BPROP_SAMPLER) != 0)
369369

@@ -3546,11 +3546,11 @@ class HLSLExternalSource : public ExternalSemaSource {
35463546

35473547
InheritableAttr *Attr = nullptr;
35483548
if (IS_BASIC_STREAM(kind))
3549-
Attr =
3550-
HLSLStreamOutputAttr::CreateImplicit(*m_context,
3551-
kind - AR_OBJECT_POINTSTREAM + 1);
3549+
Attr = HLSLStreamOutputAttr::CreateImplicit(
3550+
*m_context, kind - AR_OBJECT_POINTSTREAM + 1);
35523551
else if (IS_BASIC_PATCH(kind))
3553-
Attr = HLSLTessPatchAttr::CreateImplicit(*m_context, kind == AR_OBJECT_INPUTPATCH);
3552+
Attr = HLSLTessPatchAttr::CreateImplicit(*m_context,
3553+
kind == AR_OBJECT_INPUTPATCH);
35543554
else {
35553555
DXIL::ResourceKind ResKind = DXIL::ResourceKind::NumEntries;
35563556
DXIL::ResourceClass ResClass = DXIL::ResourceClass::Invalid;
@@ -3746,9 +3746,9 @@ class HLSLExternalSource : public ExternalSemaSource {
37463746
}
37473747
#endif
37483748
else if (templateArgCount == 0) {
3749-
recordDecl = DeclareRecordTypeWithHandle(*m_context, typeName,
3750-
/*isCompleteType*/ false,
3751-
Attr);
3749+
recordDecl =
3750+
DeclareRecordTypeWithHandle(*m_context, typeName,
3751+
/*isCompleteType*/ false, Attr);
37523752
} else {
37533753
DXASSERT(templateArgCount == 1 || templateArgCount == 2,
37543754
"otherwise a new case has been added");
@@ -5237,8 +5237,9 @@ class HLSLExternalSource : public ExternalSemaSource {
52375237
}
52385238
// Allow object type for Constant/TextureBuffer.
52395239
HLSLResourceAttr *ResAttr =
5240-
Template->getTemplatedDecl()->getAttr<HLSLResourceAttr>();
5241-
if (ResAttr && ResAttr->getResClass() == (unsigned)DXIL::ResourceClass::CBuffer) {
5240+
Template->getTemplatedDecl()->getAttr<HLSLResourceAttr>();
5241+
if (ResAttr &&
5242+
ResAttr->getResClass() == (unsigned)DXIL::ResourceClass::CBuffer) {
52425243
if (TemplateArgList.size() == 1) {
52435244
const TemplateArgumentLoc &argLoc = TemplateArgList[0];
52445245
const TemplateArgument &arg = argLoc.getArgument();
@@ -5353,7 +5354,7 @@ class HLSLExternalSource : public ExternalSemaSource {
53535354
if (ContainsVectorLongerThan(argType, DXIL::kDefaultMaxVectorLength)) {
53545355
m_sema->Diag(argLoc.getLocation(),
53555356
diag::err_hlsl_unsupported_long_vector)
5356-
<< DXIL::kDefaultMaxVectorLength << "tessellation patches";
5357+
<< DXIL::kDefaultMaxVectorLength << "tessellation patches";
53575358
return true;
53585359
}
53595360
} else if (Template->getTemplatedDecl()->hasAttr<HLSLStreamOutputAttr>()) {
@@ -5367,7 +5368,7 @@ class HLSLExternalSource : public ExternalSemaSource {
53675368
if (ContainsVectorLongerThan(argType, DXIL::kDefaultMaxVectorLength)) {
53685369
m_sema->Diag(argLoc.getLocation(),
53695370
diag::err_hlsl_unsupported_long_vector)
5370-
<< DXIL::kDefaultMaxVectorLength << "geometry streams";
5371+
<< DXIL::kDefaultMaxVectorLength << "geometry streams";
53715372
return true;
53725373
}
53735374
}

0 commit comments

Comments
 (0)