Manual-sync mirror of chromium.googlesource.com/external/github.com/llvm/llvm-project (bare monorepo, no subtree suffix)
Find a file
Pavel Labath 4db63ee847
[libc] Add inet_ntop (#204143)
The function converts from IPv4/6 addresses to their string forms. The
complication comes from the v6 part due to address compression and
v4-mapping.

The traditional implementation of this is to sprintf the address into a
temporary buffer. We cannot do that here due to the ban on calling other
entry points. Using the lower-level constructs is possible, but a
straight forward application of IntegerToString does not result in
particularly impressive performance: 50%-100% slower than what's in this
patch (and slower than glibc). It also doesn't make the code much
smaller as the majority of it is dedicated to v6 compression.

The IPv6 implementation uses a temporary buffer, but it also has a
fast-path which skips the buffer if its size is guaranteed to be
sufficient. The IPv4 implementation also has a fast path, but the
fallback here is to compute the precise length of the string instead
(the buffer option was slower and IPv4 makes it easier to compute the
precise length).

The v6 compression code is unrolled to make it easier to optimize. While
it is possible to write a single printing loop that handles all cases,
its branchiness does not make it amenable for optimization.

The resulting function is faster than its glibc counterpart, though the
exact ratio varies depending on the input:
- random IPv4: 15% faster
- random IPv6: 6% faster
- "::": 50% faster
2026-07-07 11:15:35 +00:00
.ci CI: move libclang python bindings tests to main CI (#201677) 2026-07-06 23:13:30 -03:00
.github CI: move libclang python bindings tests to main CI (#201677) 2026-07-06 23:13:30 -03:00
bolt [BOLT] Fixed PerfScript unittest for X86 (#207408) 2026-07-06 10:44:29 +02:00
clang [clang] Fix constant-evaluator crash on array new with no size (#207730) 2026-07-07 08:55:48 +00:00
clang-tools-extra [clang-tidy][docs] Update CERT links to current SEI URLs. NFC. (#207893) 2026-07-07 18:44:36 +08:00
cmake [runtimes] Don't create shared library targets when unsupported (#205517) 2026-06-29 17:53:09 +02:00
compiler-rt [X86] Remove AMX-TF32 (#207673) 2026-07-07 13:13:27 +05:30
cross-project-tests [RISCV][P-ext] Support Packed Merge. (#207110) 2026-07-06 09:29:30 +08:00
flang [FIRToMemRef] Doc collectSliceInfoFrom, getMemrefIndices, canonicalizeIndex (#207699) 2026-07-07 07:15:35 +02:00
flang-rt [Fortran] Use INTERFACE targets for options and dependencies (#193469) 2026-07-07 09:16:16 +02:00
libc [libc] Add inet_ntop (#204143) 2026-07-07 11:15:35 +00:00
libclc [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
libcxx [libc++] Mark LWG3585 as resolved (#207717) 2026-07-07 19:05:10 +08:00
libcxxabi [libc++abi] Always enable -fvisibility=hidden (#207333) 2026-07-06 09:35:11 +02:00
libsycl [libsycl] Implement memcpy API (#205369) 2026-07-07 11:29:57 +02:00
libunwind [libunwind][aarch64] Fix auth on PAuth_LR'd frames (#206814) 2026-07-01 09:11:31 -07:00
lld [ELF,test] Fix FileCheck RUN line in gc-sections-keep-shared-start.s (#207678) 2026-07-06 21:20:57 -07:00
lldb [lldb-dap] Migrate DAP launch tests (#207023) 2026-07-07 12:04:06 +01:00
llvm [AMDGPU] Save entry EXEC in whole-wave prologue with no WWM spills (#207924) 2026-07-07 13:05:38 +02:00
llvm-libgcc [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
mlir [mlir][SPIRVToLLVM] Add spirv.Unreachable to llvm.unreachable conversion (#207762) 2026-07-07 11:33:01 +02:00
offload [Offload] run clang-format on olCreateProgram unit tests (#207757) 2026-07-06 17:35:25 +02:00
openmp [OpenMP][OMPT] Map ompt_get_num_devices to runtime function (#200790) 2026-07-01 16:20:49 +02:00
orc-rt [orc-rt] Add SPSSequence serialization from iterator_range. (#207715) 2026-07-06 22:40:04 +10:00
polly [NFC] Fix "is is" typos (#206288) 2026-07-06 18:07:45 +00:00
runtimes [Fortran] Use INTERFACE targets for options and dependencies (#193469) 2026-07-07 09:16:16 +02:00
third-party Fix a warning and an uninitialized variable in benchmark (#200927) 2026-06-02 13:49:06 -07:00
utils [Bazel] Fixes cc048e8 (#207873) 2026-07-06 19:30:35 -05:00
.clang-format Enforce Unix line endings for Clang/LLVM/MLIR projects (#161460) 2025-10-02 06:09:12 -07:00
.clang-format-ignore [Docs] Update coding standard for TD files (#200848) 2026-06-01 21:35:58 +01:00
.clang-tidy Add default empty header filter regex to root .clang-tidy (#167386) 2025-11-11 01:36:25 +03:00
.git-blame-ignore-revs Add "Split clang/lib/CodeGen/CGBuiltin.cpp" to .git-blame-ignore-revs (#203419) 2026-06-12 12:03:28 +01:00
.gitattributes [libclang/python] Enable packaging clang python bindings (#125806) 2025-11-24 17:21:24 -08:00
.gitignore gitignore: Add emacs lock files (#205055) 2026-06-22 18:19:29 +02:00
.mailmap [mailmap] Add mailmap entry for myself (#189447) 2026-03-30 18:35:34 +00:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.TXT
pyproject.toml [docs] Create utils/docs (#203962) 2026-06-24 15:12:48 -04:00
README.md
SECURITY.md [SECURITY.md] add pointers to "what is a security issue" (#177372) 2026-01-22 17:19:09 -07:00

The LLVM Compiler Infrastructure

OpenSSF Scorecard OpenSSF Best Practices libc++

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.

Getting the Source Code and Building LLVM

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.

Getting in touch

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.