[all-commits] [llvm/llvm-project] 598945: [clang][Sema, Lex, Parse] Preprocessor embed in C ...
The Phantom Derpstorm via All-commits
all-commits at lists.llvm.org
Wed Jun 12 00:16:24 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5989450e0061dce8cff89d8acfdd5225c14cd065
https://github.com/llvm/llvm-project/commit/5989450e0061dce8cff89d8acfdd5225c14cd065
Author: The Phantom Derpstorm <phdofthehouse at gmail.com>
Date: 2024-06-12 (Wed, 12 Jun 2024)
Changed paths:
M clang-tools-extra/test/pp-trace/pp-trace-macro.cpp
M clang/docs/LanguageExtensions.rst
M clang/include/clang/AST/Expr.h
M clang/include/clang/AST/RecursiveASTVisitor.h
M clang/include/clang/AST/TextNodeDumper.h
M clang/include/clang/Basic/DiagnosticCommonKinds.td
M clang/include/clang/Basic/DiagnosticLexKinds.td
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/include/clang/Basic/FileManager.h
M clang/include/clang/Basic/StmtNodes.td
M clang/include/clang/Basic/TokenKinds.def
M clang/include/clang/Driver/Options.td
M clang/include/clang/Frontend/PreprocessorOutputOptions.h
M clang/include/clang/Lex/PPCallbacks.h
A clang/include/clang/Lex/PPDirectiveParameter.h
A clang/include/clang/Lex/PPEmbedParameters.h
M clang/include/clang/Lex/Preprocessor.h
M clang/include/clang/Lex/PreprocessorOptions.h
M clang/include/clang/Parse/Parser.h
M clang/include/clang/Sema/Sema.h
M clang/include/clang/Serialization/ASTBitCodes.h
M clang/lib/AST/Expr.cpp
M clang/lib/AST/ExprClassification.cpp
M clang/lib/AST/ExprConstant.cpp
M clang/lib/AST/Interp/ByteCodeExprGen.cpp
M clang/lib/AST/Interp/ByteCodeExprGen.h
M clang/lib/AST/ItaniumMangle.cpp
M clang/lib/AST/StmtPrinter.cpp
M clang/lib/AST/StmtProfile.cpp
M clang/lib/AST/TextNodeDumper.cpp
M clang/lib/Basic/FileManager.cpp
M clang/lib/Basic/IdentifierTable.cpp
M clang/lib/CodeGen/CGExprAgg.cpp
M clang/lib/CodeGen/CGExprConstant.cpp
M clang/lib/CodeGen/CGExprScalar.cpp
M clang/lib/Driver/ToolChains/Clang.cpp
M clang/lib/Frontend/CompilerInvocation.cpp
M clang/lib/Frontend/DependencyFile.cpp
M clang/lib/Frontend/DependencyGraph.cpp
M clang/lib/Frontend/InitPreprocessor.cpp
M clang/lib/Frontend/PrintPreprocessedOutput.cpp
M clang/lib/Lex/PPDirectives.cpp
M clang/lib/Lex/PPExpressions.cpp
M clang/lib/Lex/PPMacroExpansion.cpp
M clang/lib/Lex/TokenConcatenation.cpp
M clang/lib/Parse/ParseExpr.cpp
M clang/lib/Parse/ParseInit.cpp
M clang/lib/Parse/ParseTemplate.cpp
M clang/lib/Sema/SemaExceptionSpec.cpp
M clang/lib/Sema/SemaExpr.cpp
M clang/lib/Sema/SemaInit.cpp
M clang/lib/Sema/TreeTransform.h
M clang/lib/Serialization/ASTReaderStmt.cpp
M clang/lib/Serialization/ASTWriterStmt.cpp
M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
A clang/test/C/C2x/Inputs/bits.bin
A clang/test/C/C2x/Inputs/boop.h
A clang/test/C/C2x/Inputs/i.dat
A clang/test/C/C2x/Inputs/jump.wav
A clang/test/C/C2x/Inputs/s.dat
A clang/test/C/C2x/n3017.c
A clang/test/Preprocessor/Inputs/jk.txt
A clang/test/Preprocessor/Inputs/media/art.txt
A clang/test/Preprocessor/Inputs/media/empty
A clang/test/Preprocessor/Inputs/null_byte.bin
A clang/test/Preprocessor/Inputs/numbers.txt
A clang/test/Preprocessor/Inputs/single_byte.txt
A clang/test/Preprocessor/embed___has_embed.c
A clang/test/Preprocessor/embed___has_embed_parsing_errors.c
A clang/test/Preprocessor/embed___has_embed_supported.c
A clang/test/Preprocessor/embed_art.c
A clang/test/Preprocessor/embed_codegen.cpp
A clang/test/Preprocessor/embed_constexpr.cpp
A clang/test/Preprocessor/embed_dependencies.c
A clang/test/Preprocessor/embed_ext_compat_diags.c
A clang/test/Preprocessor/embed_feature_test.cpp
A clang/test/Preprocessor/embed_file_not_found_chevron.c
A clang/test/Preprocessor/embed_file_not_found_quote.c
A clang/test/Preprocessor/embed_init.c
A clang/test/Preprocessor/embed_parameter_if_empty.c
A clang/test/Preprocessor/embed_parameter_limit.c
A clang/test/Preprocessor/embed_parameter_offset.c
A clang/test/Preprocessor/embed_parameter_prefix.c
A clang/test/Preprocessor/embed_parameter_suffix.c
A clang/test/Preprocessor/embed_parameter_unrecognized.c
A clang/test/Preprocessor/embed_parsing_errors.c
A clang/test/Preprocessor/embed_path_chevron.c
A clang/test/Preprocessor/embed_path_quote.c
A clang/test/Preprocessor/embed_preprocess_to_file.c
A clang/test/Preprocessor/embed_single_entity.c
A clang/test/Preprocessor/embed_weird.cpp
M clang/test/Preprocessor/init-aarch64.c
M clang/test/Preprocessor/init.c
A clang/test/Preprocessor/single_byte.txt
M clang/tools/libclang/CXCursor.cpp
M clang/www/c_status.html
Log Message:
-----------
[clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (#68620)
This commit implements the entirety of the now-accepted [N3017 -
Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and
its sister C++ paper [p1967](https://wg21.link/p1967). It implements
everything in the specification, and includes an implementation that
drastically improves the time it takes to embed data in specific
scenarios (the initialization of character type arrays). The mechanisms
used to do this are used under the "as-if" rule, and in general when the
system cannot detect it is initializing an array object in a variable
declaration, will generate EmbedExpr AST node which will be expanded
by AST consumers (CodeGen or constant expression evaluators) or
expand embed directive as a comma expression.
---------
Co-authored-by: Aaron Ballman <aaron at aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot at gmail.com>
Co-authored-by: H. Vetinari <h.vetinari at gmx.com>
Co-authored-by: Podchishchaeva, Mariya <mariya.podchishchaeva at intel.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list