commit | 47ecd18f24d338d83c3a06dd1c7906b35edb8d91 | [log] [tgz] |
---|---|---|
author | Dominik Steenken <dost@de.ibm.com> | Mon Jun 30 11:40:43 2025 +0200 |
committer | GitHub <noreply@github.com> | Mon Jun 30 11:40:43 2025 +0200 |
tree | 43608034437ebf55ae71c8463a2b9f6588267fdf | |
parent | d0c1ea928c5c4a99689ff3dcbf1ca578d56b80a3 [diff] |
Global string alignment (#142346) When creating global strings, some targets have requirements that need to be taken into account. Previously, the global strings created by `IRBuilder::createGlobalString` had a hard-coded alignment of `1`. This commit makes it so that the alignment is taken from the data layout instead, giving targets the chance to align global strings according to their preferences. This PR is motivated by (and should fix) #141491, where the 1-byte alignment in a global string created by a `printf` optimization led to the resulting assembly in a `-fno-PIC` compile to unexpectedly reference the GOT based on whether the code contained `printf` statements of the form `printf("foo\n");`.
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.