Skip to content

Commit 8b2ac55

Browse files
authored
Merge branch 'main' into users/el-ev/cleanup-c-fn-noproto
2 parents dbe66e5 + 9c4c242 commit 8b2ac55

File tree

66 files changed

+2323
-1749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2323
-1749
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ describes how to get involved, raise issues and submit patches.
99

1010
## Getting in touch
1111

12-
Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
13-
chat](https://discord.gg/xS7Z362), or #llvm IRC channel on
14-
[OFTC](https://oftc.net/).
12+
Join the [LLVM Discourse forums](https://discourse.llvm.org/) or [Discord
13+
chat](https://discord.gg/xS7Z362).
1514

1615
The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
1716
participants to all modes of communication within the project.

bolt/Maintainers.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ what goes in or not.
55

66
The list is sorted by surname and formatted to allow easy grepping and
77
beautification by scripts. The fields are: name (N), email (E), web-address
8-
(W), PGP key ID and fingerprint (P), description (D), snail-mail address
9-
(S) and (I) IRC handle. Each entry should contain at least the (N), (E) and
10-
(D) fields.
8+
(W), PGP key ID and fingerprint (P), and description (D). Each entry should
9+
contain at least the (N), (E) and (D) fields.
1110

1211
N: Maksim Panchenko, Rafael Auler
1312

clang-tools-extra/Maintainers.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ assistance.
1515
Lead Maintainer
1616
---------------
1717
| Aaron Ballman
18-
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
18+
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
1919

2020

2121
clang-tidy
@@ -33,7 +33,7 @@ clang-tidy
3333
clang-query
3434
-----------
3535
| Aaron Ballman
36-
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
36+
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
3737

3838

3939
clang-doc

clang/Maintainers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assistance.
2020
Lead Maintainer
2121
---------------
2222
| Aaron Ballman
23-
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
23+
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
2424
2525

2626
Contained Components
@@ -31,7 +31,7 @@ Clang that are typically contained to one area of the compiler.
3131
AST matchers
3232
~~~~~~~~~~~~
3333
| Aaron Ballman
34-
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
34+
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
3535
3636

3737
AST Visitors
@@ -300,7 +300,7 @@ standard, when fixing standards bugs, or when implementing a new standard featur
300300
C conformance
301301
~~~~~~~~~~~~~
302302
| Aaron Ballman
303-
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
303+
| aaron\@aaronballman.com (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
304304
305305

306306
C++ conformance

clang/include/clang/Lex/HLSLRootSignatureTokenKinds.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ PUNCTUATOR(minus, '-')
7575
// RootElement Keywords:
7676
KEYWORD(RootSignature) // used only for diagnostic messaging
7777
KEYWORD(DescriptorTable)
78+
KEYWORD(RootConstants)
79+
80+
// RootConstants Keywords:
81+
KEYWORD(num32BitConstants)
7882

7983
// DescriptorTable Keywords:
8084
KEYWORD(CBV)

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class RootSignatureParser {
7171
// expected, or, there is a lexing error
7272

7373
/// Root Element parse methods:
74+
std::optional<llvm::hlsl::rootsig::RootConstants> parseRootConstants();
7475
std::optional<llvm::hlsl::rootsig::DescriptorTable> parseDescriptorTable();
7576
std::optional<llvm::hlsl::rootsig::DescriptorTableClause>
7677
parseDescriptorTableClause();

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ RootSignatureParser::RootSignatureParser(SmallVector<RootElement> &Elements,
2727
bool RootSignatureParser::parse() {
2828
// Iterate as many RootElements as possible
2929
do {
30+
if (tryConsumeExpectedToken(TokenKind::kw_RootConstants)) {
31+
auto Constants = parseRootConstants();
32+
if (!Constants.has_value())
33+
return true;
34+
Elements.push_back(*Constants);
35+
}
36+
3037
if (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) {
3138
auto Table = parseDescriptorTable();
3239
if (!Table.has_value())
@@ -35,12 +42,27 @@ bool RootSignatureParser::parse() {
3542
}
3643
} while (tryConsumeExpectedToken(TokenKind::pu_comma));
3744

38-
if (consumeExpectedToken(TokenKind::end_of_stream,
45+
return consumeExpectedToken(TokenKind::end_of_stream,
46+
diag::err_hlsl_unexpected_end_of_params,
47+
/*param of=*/TokenKind::kw_RootSignature);
48+
}
49+
50+
std::optional<RootConstants> RootSignatureParser::parseRootConstants() {
51+
assert(CurToken.TokKind == TokenKind::kw_RootConstants &&
52+
"Expects to only be invoked starting at given keyword");
53+
54+
if (consumeExpectedToken(TokenKind::pu_l_paren, diag::err_expected_after,
55+
CurToken.TokKind))
56+
return std::nullopt;
57+
58+
RootConstants Constants;
59+
60+
if (consumeExpectedToken(TokenKind::pu_r_paren,
3961
diag::err_hlsl_unexpected_end_of_params,
40-
/*param of=*/TokenKind::kw_RootSignature))
41-
return true;
62+
/*param of=*/TokenKind::kw_RootConstants))
63+
return std::nullopt;
4264

43-
return false;
65+
return Constants;
4466
}
4567

4668
std::optional<DescriptorTable> RootSignatureParser::parseDescriptorTable() {

clang/unittests/Lex/LexHLSLRootSignatureTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ TEST_F(LexHLSLRootSignatureTest, ValidLexAllTokensTest) {
128128
129129
RootSignature
130130
131-
DescriptorTable
131+
DescriptorTable RootConstants
132+
133+
num32BitConstants
132134
133135
CBV SRV UAV Sampler
134136
space visibility flags

clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,32 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) {
252252
ASSERT_TRUE(Consumer->isSatisfied());
253253
}
254254

255+
TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) {
256+
const llvm::StringLiteral Source = R"cc(
257+
RootConstants()
258+
)cc";
259+
260+
TrivialModuleLoader ModLoader;
261+
auto PP = createPP(Source, ModLoader);
262+
auto TokLoc = SourceLocation();
263+
264+
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
265+
SmallVector<RootElement> Elements;
266+
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
267+
268+
// Test no diagnostics produced
269+
Consumer->setNoDiag();
270+
271+
ASSERT_FALSE(Parser.parse());
272+
273+
ASSERT_EQ(Elements.size(), 1u);
274+
275+
RootElement Elem = Elements[0];
276+
ASSERT_TRUE(std::holds_alternative<RootConstants>(Elem));
277+
278+
ASSERT_TRUE(Consumer->isSatisfied());
279+
}
280+
255281
TEST_F(ParseHLSLRootSignatureTest, ValidTrailingCommaTest) {
256282
// This test will checks we can handling trailing commas ','
257283
const llvm::StringLiteral Source = R"cc(

clang/www/menu.html.incl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<a href="https://discourse.llvm.org/c/clang">Clang Forum</a>
3737
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits List</a>
3838
<a href="https://github.com/llvm/llvm-project/issues">Bug Reports</a>
39-
<a href="irc://irc.oftc.net/llvm">IRC: irc.oftc.net#llvm</a>
39+
<a href="https://discord.gg/2kQU7PCuys">Discord</a>
4040
</div>
4141

4242
<div class="submenu">

0 commit comments

Comments
 (0)