These both have the same result that the relevant include paths are
propagated to all dependents, but includes is dedup'd where
strip_include_prefix is not. So this reduces >100 include paths for all
transitive dependents.
LLVM has two tablegen generators: one in llvm/tblgen.bzl (`gentbl`,
macro-based) and one in mlir/tblgen.bzl (`gentbl_cc_library`,
rule-based). The `gentbl_cc_library` generator in MLIR has some
advantages to being a rule, and at any rate, it seems better to just use
the same tablegen rule everywhere instead of competing implementations.
In the discussion around #116792, @rjmccall mentioned that ARCMigrate
has been obsoleted and that we could go ahead and remove it from Clang,
so this patch does just that.
For example, `include/llvm/DebugInfo/DWARF/DWARFContext.h` is included
as part of both the generic "DebugInfo" target as well as the specific
"DebugInfoDWARF" target. It should only be in one. Tooling that manages
build dependencies should be more accurate now.
This commit introduces a new MathToEmitC conversion pass that lowers
selected math operations from the Math dialect to the emitc.call_opaque
operation in the EmitC dialect.
**Supported Math Operations:**
The following operations are converted:
- math.floor -> emitc.call_opaque<"floor">
- math.round -> emitc.call_opaque<"round">
- math.exp -> emitc.call_opaque<"exp">
- math.cos -> emitc.call_opaque<"cos">
- math.sin -> emitc.call_opaque<"sin">
- math.acos -> emitc.call_opaque<"acos">
- math.asin -> emitc.call_opaque<"asin">
- math.atan2 -> emitc.call_opaque<"atan2">
- math.ceil -> emitc.call_opaque<"ceil">
- math.absf -> emitc.call_opaque<"fabs">
- math.powf -> emitc.call_opaque<"pow">
**Target Language Standards:**
The pass supports targeting different language standards:
- C99: Generates calls with suffixes (e.g., floorf, fabsf) for
single-precision floats.
- CPP11: Prepends std:: to functions (e.g., std::floor, std::fabs).
**Design Decisions:**
The pass uses emitc.call_opaque instead of emitc.call to better emulate
C-style function overloading.
emitc.call_opaque does not require a unique type signature, making it
more suitable for operations like <math.h> functions that may be
overloaded for different types.
This design choice ensures compatibility with C/C++ conventions.
This target exists to allow `#include "Header.h"` for headers in
lib/Basic rather than using file-relative inclusion. This is rather
hacky and results in having two targets that claim the same headers.
Instead, we can pass a `-I` flag in the `copts` for //clang:basic, to
adjust the include path to keep those `#include "Header.h"` directives
working. There are other targets in this file already doing a similar
thing for generated files.
We're currently excluding Wasm.cpp, because it requires emscripten. When
using header modules, Wasm.h gets compiled on its own and it also
requires emscripten, so we need to exclude both.