Skip to content

Commit 19b26d3

Browse files
authored
[HLSL][NFC] Cleanup - removed unused function, includes and param, fix typos (#113649)
1 parent 847d4eb commit 19b26d3

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include "clang/AST/Attr.h"
1515
#include "clang/AST/DeclCXX.h"
1616
#include "clang/AST/Type.h"
17-
#include "clang/Basic/AttrKinds.h"
18-
#include "clang/Basic/HLSLRuntime.h"
1917
#include "clang/Basic/SourceLocation.h"
2018
#include "clang/Sema/Lookup.h"
2119
#include "clang/Sema/Sema.h"
@@ -164,16 +162,7 @@ struct BuiltinTypeDeclBuilder {
164162
VD, false, NameInfo, Ty, VK_PRValue);
165163
}
166164

167-
static Expr *emitResourceClassExpr(ASTContext &AST, ResourceClass RC) {
168-
return IntegerLiteral::Create(
169-
AST,
170-
llvm::APInt(AST.getIntWidth(AST.UnsignedCharTy),
171-
static_cast<uint8_t>(RC)),
172-
AST.UnsignedCharTy, SourceLocation());
173-
}
174-
175-
BuiltinTypeDeclBuilder &addDefaultHandleConstructor(Sema &S,
176-
ResourceClass RC) {
165+
BuiltinTypeDeclBuilder &addDefaultHandleConstructor(Sema &S) {
177166
if (Record->isCompleteDefinition())
178167
return *this;
179168
ASTContext &AST = Record->getASTContext();
@@ -480,7 +469,7 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S,
480469
bool IsROV, bool RawBuffer) {
481470
return BuiltinTypeDeclBuilder(Decl)
482471
.addHandleMember(S, RC, RK, IsROV, RawBuffer)
483-
.addDefaultHandleConstructor(S, RC);
472+
.addDefaultHandleConstructor(S);
484473
}
485474

486475
void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {

clang/test/AST/HLSL/RWBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class RWBuffer
1616
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
1717

18-
// There should be no more occurrances of RWBuffer
18+
// There should be no more occurrences of RWBuffer
1919
// EMPTY-NOT: RWBuffer
2020

2121
#ifndef EMPTY

clang/test/AST/HLSL/RWStructuredBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class RWStructuredBuffer
1717
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
1818

19-
// There should be no more occurrances of RWStructuredBuffer
19+
// There should be no more occurrences of RWStructuredBuffer
2020
// EMPTY-NOT: {{[^[:alnum:]]}}RWStructuredBuffer
2121

2222
#ifndef EMPTY

clang/test/AST/HLSL/StructuredBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class StructuredBuffer
1717
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
1818

19-
// There should be no more occurrances of StructuredBuffer
19+
// There should be no more occurrences of StructuredBuffer
2020
// EMPTY-NOT: {{[^[:alnum:]]}}StructuredBuffer
2121

2222
#ifndef EMPTY

0 commit comments

Comments
 (0)