2515 Commits

Author SHA1 Message Date
Haojian Wu
dcb7a69500 [bazel] Remove a duplicated dep 2025-02-04 09:42:57 +01:00
Alexander Belyaev
eaf34eed0b Fix BAZEL build after 93fcef3048b453161d462ed7defd480fb448c228 2025-02-04 09:06:52 +01:00
Haojian Wu
5ed5ada398 [bazel] Port for 93fcef3, part 2 2025-02-04 08:57:01 +01:00
Haojian Wu
e78074ef52 [bazel] Port for 93fcef3 2025-02-04 08:34:02 +01:00
Keith Smiley
fa6b7ec894
[bazel] Replace strip_include_prefix in lldb with includes (#125293)
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.
2025-01-31 13:16:31 -08:00
Jorge Gorbe Moya
0ff49a745a [bazel] add missing dep after 5fbb8dd7da5cd8b76127e780d418fe780d3337a4 2025-01-31 10:43:27 -08:00
Jordan Rupprecht
a643e44974
[bazel] Replace gentbl with gentbl_cc_library (#124996)
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.
2025-01-30 11:00:19 -06:00
NAKAMURA Takumi
b8d4ba674b [bazel] Disable CLANG_ENABLE_OBJC_REWRITER (for #119269) 2025-01-30 17:11:37 +09:00
Jordan Rupprecht
31fa4e0b32
[bazel] Port cdc09a118a7107b8e13ba5a254d3d794f51f9818 (#125030) 2025-01-29 23:43:42 -06:00
Jordan Rupprecht
f50ca2e8a6
[bazel] Remove more references to ARCMigrate (#125027)
c4a019747c98ad9326a675d3cb5a70311ba170a2 removed arc_migrate targets but
accidentally left a few references to the now deleted target. Remove
those.
2025-01-29 23:25:48 -06:00
Sirraide
c4a019747c
[Clang] Remove ARCMigrate (#119269)
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.
2025-01-30 05:32:25 +01:00
Benjamin Kramer
d444558f51 [bazel] Port 25ae1a266d50f24a8fffc57152d7f3c3fcb65517 2025-01-29 18:14:51 +01:00
NAKAMURA Takumi
267e293510 [bazel] Introduce MAX_CLANG_ABI_COMPAT_VERSION (for #123998) 2025-01-29 16:46:33 +09:00
Jorge Gorbe Moya
3a1e157454 [bazel] More fixes for 35df525fd00c2037ef144189ee818b7d612241ff
I missed a couple spots in my previous attempt to fix the build
(4eb7c349a616827a3ec9bea57718516409103caa).
2025-01-28 14:49:24 -08:00
Jorge Gorbe Moya
4eb7c349a6 [bazel] Fix build after 35df525fd00c2037ef144189ee818b7d612241ff 2025-01-28 14:33:07 -08:00
Jorge Gorbe Moya
b108fbe6ea [bazel] Fixes for 7f37b34, 0165e33 and 3c64f86 2025-01-28 10:42:46 -08:00
Jordan Rupprecht
431024506c
[bazel] Remove DebugInfo files covered by more specific targets (#124138)
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.
2025-01-28 06:07:31 -06:00
NAKAMURA Takumi
d69b785733 [bazel] Add Builtins for #122873(NVPTX) and #123460(Hexagon) 2025-01-28 18:58:00 +09:00
Jorge Gorbe Moya
d606f68a2e [bazel] Fix build after e0c7f081f1582d49f81ec4c6cdbf5d6ef13c58ba 2025-01-27 21:42:40 -08:00
Benjamin Kramer
658f8500c8 [bazel] Remove obsolete mlir-cpu-runner alias 2025-01-27 18:38:12 +01:00
Benjamin Kramer
77c780d64b [bazel] Port eb206e9ea84eff0a0596fed2de8316d924f946d1
Leave around an alias so users can move at their own pace.
2025-01-24 15:11:54 +01:00
Karlo Basioli
0510d4ea59
[bazel]Fix bazel build after 631a6e0004e57ca85569b99ea411418627925697 2025-01-24 10:40:48 +01:00
Benjamin Kramer
3ed28bbf19 [bazel] Generate CXX11AttributeInfo.inc for 4018317407006b2c632fbb75729de624a2426439 2025-01-23 22:13:46 +01:00
Jordan Rupprecht
d17e4ca7e0
[bazel][NFC] Add td_library for downstream use (#124156)
This will allow td_library/gentbl_cc_library in other packages to use
these td files.
2025-01-23 13:23:51 -06:00
Oleksandr T.
4018317407
[Clang] restrict use of attribute names reserved by the C++ standard (#106036)
Fixes #92196

https://eel.is/c++draft/macro.names#2
> A translation unit shall not #define or #undef names lexically
identical to keywords, to the identifiers listed in Table
[4](https://eel.is/c++draft/lex.name#tab:lex.name.special), or to the
[attribute-token](https://eel.is/c++draft/dcl.attr.grammar#nt:attribute-token)s
described in [[dcl.attr]](https://eel.is/c++draft/dcl.attr), except that
the names likely and unlikely may be defined as function-like macros
([[cpp.replace]](https://eel.is/c++draft/cpp.replace))[.](https://eel.is/c++draft/macro.names#2.sentence-1)
2025-01-23 21:16:59 +02:00
Danial Klimkin
4d3a530924
[bazel]Fix(2) bazel build past 2e6cc79f816d942ab09d6a310cd925c1da148aa9 (#124118)
Fix caused link errors downstream.
2025-01-23 15:21:33 +01:00
Danial Klimkin
0c66644270
[bazel]Fix bazel build past 2e6cc79f816d942ab09d6a310cd925c1da148aa9 (#124112)
Split target under LLVMIR/Transforms to avoid deps loop.
2025-01-23 14:20:11 +01:00
Fangrui Song
58c6d440f8
[CMake] Remove HAVE_DLFCN_H and HAVE_DLADDR (#123879)
It is sufficient to just use `HAVE_DLOPEN`.
2025-01-22 08:15:10 -08:00
NAKAMURA Takumi
ec0958c0b7 [bazel] Reorder targets 2025-01-22 09:03:46 +09:00
NAKAMURA Takumi
68fdc09eb5 [bazel] Add SPIRV 2025-01-22 09:03:45 +09:00
Danial Klimkin
b7abc510c5
[bazel]Fix bazel build past e7e3c45bc70904e24e2b3221ac8521e67eb84668 (#123780) 2025-01-21 18:00:59 +01:00
Benjamin Kramer
0f8297ae0b [bazel] Fix dependencies for 69d3ba3db922fca8cfc47b5f115b6bea6a737aab 2025-01-20 11:46:44 +01:00
Tomer Solomon
c0055ec434
[mlir][EmitC] Add MathToEmitC pass for math function lowering to EmitC (#113799)
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.
2025-01-20 09:26:41 +01:00
Jorge Gorbe Moya
3065cf238c
[bazel] Remove //clang:basic_internal_headers target (NFC) (#123230)
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.
2025-01-17 09:34:23 -08:00
Benjamin Kramer
0d7c8c0e29
[bazel] Add new file added in 437834e16be6d04e7b198dad8a42d507770251a1 2025-01-17 12:07:52 +01:00
Fangrui Song
414980d061
[CMake] Remove HAVE_SYS_RESOURCE_H/HAVE_SETRLIMIT/HAVE_GETRLIMIT
Only used by Unix/Program.inc and seem always available.

Pull Request: https://github.com/llvm/llvm-project/pull/123288
2025-01-16 22:44:54 -08:00
Fangrui Song
219beb7aca [CMake] Remove HAVE_SYS_IOCTL_H 2025-01-16 21:52:01 -08:00
Fangrui Song
86a81d424c [CMake] Remove HAVE_TERMIOS_H
The code path has been dead since 2019.
See a3eb3d3d92d037fe3c9deaad87f6fc42fe9ea766
2025-01-16 21:48:27 -08:00
Fangrui Song
f999b11e68
[CMake] Remove some unneeded HAVE_*_H
Pull Request: https://github.com/llvm/llvm-project/pull/123282
2025-01-16 21:37:24 -08:00
Jorge Gorbe Moya
a5bd01e889 [bazel] Exclude lib/Interpreter/Wasm.h from //clang:interpreter
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.
2025-01-16 16:54:24 -08:00
Jorge Gorbe Moya
4e9f04c5fa [bazel] Remove a couple of unused dependencies 2025-01-16 15:24:53 -08:00
Yijia Gu
a87215bc88 [mlir][test][bazel] add missing deps for TestPass 2025-01-16 13:51:06 -08:00
Jorge Gorbe Moya
842ce4efdd [bazel] Remove useless exclusion from glob (NFC)
The excluded file doesn't match the glob pattern to begin with, so it's
unnecessary.
2025-01-16 11:41:14 -08:00
Jorge Gorbe Moya
4b06b01e62 [bazel] Add missing file to textual_hdrs in //clang:basic (NFC) 2025-01-16 11:13:21 -08:00
Jorge Gorbe Moya
0e417a700f
[bazel] Add rules for clang-fuzzer protobuf-related libraries (#123126)
Also bumped up bazel_skylib to the latest version because the proto
rules were complaining about a missing feature.
2025-01-16 10:12:46 -08:00
Jorge Gorbe Moya
d2d531e097
[clang][Serialization] Stop including Frontend headers from Serialization (NFC) (#123140)
The Frontend library depends on Serialization. This is an explicit
dependency encoded in the CMake target. However, Serialization currently
has an implicit dependency on Frontend, as it includes one of its
headers. This is not reflected in the CMake build rules, but Bazel is
stricter so, in order to avoid a dependency cycle, it hackily declares
the Frontend headers as source files for Serialization.

Fortunately, the only Frontend header used by Serialization is
clang/Frontend/FrontendDiagnostic.h, which is a legacy header that just
includes clang/Basic/DiagnosticFrontend since
d076608d58d1ec55016eb747a995511e3a3f72aa, back in 2018.

This commit changes Serialization to use the underlying header from
Basic instead. Both Serialization and Frontend depend on Basic, so this
breaks the dependency cycle.
2025-01-16 10:12:04 -08:00
Benjamin Kramer
cea41e9f4c [bazel] Port bf17016a92bc8a23d2cdd2b51355dd4eb5019c68 2025-01-15 23:06:16 +01:00
Jorge Gorbe Moya
2bc422dfa7
[bazel] Remove internal headers from hdrs in //clang:format (#122987)
They are already included in `srcs`, as they should be.
2025-01-15 10:31:07 -08:00
Fangrui Song
1e53f9523d
[CMake] Remove some always-true HAVE_XXX_H
These are unneeded even on AIX, PURE_WINDOWS, and ZOS (per #104706)

* HAVE_ERRNO_H: introduced by 1a93330ffa2ae2aa0b49461f05e6f0d51e8443f8 (2009) but unneeded.
  The guarded ABI is unconditionally used by lldb.
* HAVE_FCNTL_H
* HAVE_FENV_H
* HAVE_SYS_STAT_H

Pull Request: https://github.com/llvm/llvm-project/pull/123087
2025-01-15 09:53:21 -08:00
Jorge Gorbe Moya
43f203da89 [bazel] add missing dep 2025-01-14 14:17:31 -08:00