Skip to content

Commit 8690bb3

Browse files
committed
self-review: remove ast allocation
1 parent 57f60c3 commit 8690bb3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5267,20 +5267,13 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) {
52675267
1); // offset 1 for '"'
52685268
// Invoke the root signature parser to construct the in-memory constructs
52695269
hlsl::RootSignatureLexer Lexer(Signature, SignatureLoc);
5270-
SmallVector<llvm::hlsl::rootsig::RootElement> Elements;
5271-
hlsl::RootSignatureParser Parser(Elements, Lexer, PP);
5270+
SmallVector<llvm::hlsl::rootsig::RootElement> RootElements;
5271+
hlsl::RootSignatureParser Parser(RootElements, Lexer, PP);
52725272
if (Parser.parse()) {
52735273
T.consumeClose();
52745274
return;
52755275
}
52765276

5277-
// Allocate the root elements onto ASTContext
5278-
unsigned N = Elements.size();
5279-
auto RootElements = MutableArrayRef<llvm::hlsl::rootsig::RootElement>(
5280-
::new (Actions.getASTContext()) llvm::hlsl::rootsig::RootElement[N], N);
5281-
for (unsigned I = 0; I < N; ++I)
5282-
RootElements[I] = Elements[I];
5283-
52845277
// Create the Root Signature
52855278
auto *SignatureDecl = HLSLRootSignatureDecl::Create(
52865279
Actions.getASTContext(), /*DeclContext=*/Actions.CurContext,

0 commit comments

Comments
 (0)