Skip to content

Commit 4f7a0e2

Browse files
committed
review comments:
- remove bad use of namespaces - simplify test case checking
1 parent f1b7dc9 commit 4f7a0e2

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,6 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS,
649649
}
650650

651651
void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
652-
using namespace llvm::hlsl::root_signature;
653-
using namespace clang::hlsl;
654-
655652
if (AL.getNumArgs() != 1)
656653
return;
657654

@@ -662,26 +659,26 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
662659
SourceLocation Loc = AL.getArgAsExpr(0)->getExprLoc();
663660
// FIXME: pass down below to lexer when fp is supported
664661
// llvm::RoundingMode RM = SemaRef.CurFPFeatures.getRoundingMode();
665-
SmallVector<RootSignatureToken> Tokens;
666-
RootSignatureLexer Lexer(Signature, Loc, SemaRef.getPreprocessor());
662+
SmallVector<hlsl::RootSignatureToken> Tokens;
663+
hlsl::RootSignatureLexer Lexer(Signature, Loc, SemaRef.getPreprocessor());
667664
if (Lexer.Lex(Tokens))
668665
return;
669666

670-
SmallVector<RootElement> Elements;
671-
RootSignatureParser Parser(Elements, Tokens,
667+
SmallVector<llvm::hlsl::root_signature::RootElement> Elements;
668+
hlsl::RootSignatureParser Parser(Elements, Tokens,
672669
SemaRef.getPreprocessor().getDiagnostics());
673670
if (Parser.Parse())
674671
return;
675672

676673
unsigned N = Elements.size();
677674
auto RootElements =
678-
MutableArrayRef<RootElement>(::new (getASTContext()) RootElement[N], N);
675+
MutableArrayRef<llvm::hlsl::root_signature::RootElement>(::new (getASTContext()) llvm::hlsl::root_signature::RootElement[N], N);
679676
for (unsigned I = 0; I < N; ++I)
680677
RootElements[I] = Elements[I];
681678

682679
auto *Result = ::new (getASTContext())
683680
HLSLRootSignatureAttr(getASTContext(), AL, Signature);
684-
Result->setElements(ArrayRef<RootElement>(RootElements));
681+
Result->setElements(ArrayRef<llvm::hlsl::root_signature::RootElement>(RootElements));
685682
D->addAttr(Result);
686683
}
687684

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"), " \
1616
"DescriptorTable(Sampler(s0, numDescriptors = 4, space = 1))"
1717

18-
// CHECK: HLSLRootSignatureAttr 0x{{[0-9A-Fa-f]+}} <line:{{[0-9]+}}:{{[0-9]+}}, col:{{[0-9]+}}>
18+
// CHECK: HLSLRootSignatureAttr
1919
// CHECK-SAME: "DescriptorTable(
2020
// CHECK-SAME: CBV(b1),
2121
// CHECK-SAME: SRV(t1, numDescriptors = 8,

0 commit comments

Comments
 (0)