Skip to content

Commit

Permalink
[HLSL][NFC] Cleanup - removed unused function, includes and param, fi…
Browse files Browse the repository at this point in the history
…x typos (llvm#113649)
  • Loading branch information
hekota authored Nov 5, 2024
1 parent 847d4eb commit 19b26d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
15 changes: 2 additions & 13 deletions clang/lib/Sema/HLSLExternalSemaSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Type.h"
#include "clang/Basic/AttrKinds.h"
#include "clang/Basic/HLSLRuntime.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"
Expand Down Expand Up @@ -164,16 +162,7 @@ struct BuiltinTypeDeclBuilder {
VD, false, NameInfo, Ty, VK_PRValue);
}

static Expr *emitResourceClassExpr(ASTContext &AST, ResourceClass RC) {
return IntegerLiteral::Create(
AST,
llvm::APInt(AST.getIntWidth(AST.UnsignedCharTy),
static_cast<uint8_t>(RC)),
AST.UnsignedCharTy, SourceLocation());
}

BuiltinTypeDeclBuilder &addDefaultHandleConstructor(Sema &S,
ResourceClass RC) {
BuiltinTypeDeclBuilder &addDefaultHandleConstructor(Sema &S) {
if (Record->isCompleteDefinition())
return *this;
ASTContext &AST = Record->getASTContext();
Expand Down Expand Up @@ -480,7 +469,7 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S,
bool IsROV, bool RawBuffer) {
return BuiltinTypeDeclBuilder(Decl)
.addHandleMember(S, RC, RK, IsROV, RawBuffer)
.addDefaultHandleConstructor(S, RC);
.addDefaultHandleConstructor(S);
}

void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/AST/HLSL/RWBuffer-AST.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class RWBuffer
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final

// There should be no more occurrances of RWBuffer
// There should be no more occurrences of RWBuffer
// EMPTY-NOT: RWBuffer

#ifndef EMPTY
Expand Down
2 changes: 1 addition & 1 deletion clang/test/AST/HLSL/RWStructuredBuffer-AST.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class RWStructuredBuffer
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final

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

#ifndef EMPTY
Expand Down
2 changes: 1 addition & 1 deletion clang/test/AST/HLSL/StructuredBuffer-AST.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class StructuredBuffer
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final

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

#ifndef EMPTY
Expand Down

0 comments on commit 19b26d3

Please sign in to comment.