| commit | 2d31fc85a847759a5ea1fb39718a3851d57913c3 | [log] [tgz] |
|---|---|---|
| author | Naveen Seth Hanig <naveen.hanig@outlook.com> | Mon Jul 21 22:34:14 2025 +0200 |
| committer | GitHub <noreply@github.com> | Mon Jul 21 22:34:14 2025 +0200 |
| tree | 9d5e94766638e5eb5c1cf33db5c465e3532d7243 | |
| parent | e47d5eb4541d5f377d9a57ef2157dbb3a41a85e6 [diff] |
Reland [clang][modules-driver] Add scanner to detect C++20 module presence (#147630) This patch is part of a series to natively support C++20 module usage from the Clang driver (without requiring an external build system). This introduces a new scanner that detects C++20 module usage in source files without using the preprocessor or lexer. For now, it is enabled only with the `-fmodules-driver` flag and serves solely diagnostic purposes. In the future, the scanner will be enabled for any (modules-driver compatible) compilation with two or more inputs, and will help the driver determine whether to implicitly enable the modules driver. Since the scanner adds very little overhead, we are also exploring enabling it for compilations with only a single input. This approach could allow us to detect `import std` usage in a single-file compilation, which would then activate the modules driver. For performance measurements on this, see https://github.com/naveen-seth/llvm-dev-cxx-modules-check-benchmark. RFC: https://discourse.llvm.org/t/rfc-modules-support-simple-c-20-modules-use-from-the-clang-driver-without-a-build-system This patch relands commit ded1426. The CI failure is resolved by removing the compatibility warning for using the `-fmodules-driver` flag with pre-C++20 standards, which also better aligns its behavior with other features/flags supported only in newer standards.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.