From e77a01d79a48e15c94c89e4aa4bd27424a96b49b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 20 Jul 2024 20:41:00 +0800 Subject: =?UTF-8?q?[Clang]=20Implement=20P3034R1=20Module=20Declarations?= =?UTF-8?q?=20Shouldn=E2=80=99t=20be=20Macros=20(#90574)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR implement [P3034R1 Module Declarations Shouldn’t be Macros](https://wg21.link/P3034R1), and refactor the convoluted state machines in module name lexical analysis. --------- Signed-off-by: yronglin Co-authored-by: Aaron Ballman Co-authored-by: cor3ntin --- clang/lib/Basic/IdentifierTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Basic/IdentifierTable.cpp') diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 4f7ccaf..97d8302 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -322,8 +322,9 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) { if (LangOpts.IEEE128) AddKeyword("__ieee128", tok::kw___float128, KEYALL, LangOpts, *this); - // Add the 'import' contextual keyword. + // Add the 'import' and 'module' contextual keyword. get("import").setModulesImport(true); + get("module").setModulesDeclaration(true); } /// Checks if the specified token kind represents a keyword in the -- cgit v1.1