llvm-project:基于编译器技术的基础设施项目

LLVM 项目是一个模块化、可复用的编译器及工具链技术的集合。此fork用于添加仓颉编译器的功能,并支持仓颉编译器项目。

Branch60Tags362
FilesLast commitLast update
feat: sync dev to main18 days ago
feat: sync dev to main18 days ago
[BOLT] Use Optional::emplace to avoid move assignment. NFC3 years ago
[clangd] Return earlier when snippet is empty3 years ago
[clang][Sema] Fix a clang crash with btf_type_tag3 years ago
[cmake] Fix missing paren in FindPrefixFromConfig3 years ago
feat: sync dev to main18 days ago
Pretty printer test fixes3 years ago
[DOCS] Minor fixes and removals of WIP warnings3 years ago
[libc] Use nearest_integer instructions to improve expm1f performance.3 years ago
Remove references to old mailing lists that have moved to discourse. Replace with links to discourse.3 years ago
Bump version to 15.0.43 years ago
Remove references to old mailing lists that have moved to discourse. Replace with links to discourse.3 years ago
[libunwind][SystemZ] Use process_vm_readv to avoid potential segfaults3 years ago
fix: all visible packdges30 days ago
chore: update version to 1.2.0-alpha.2211 hours ago
[cmake] Slight fix ups to make robust to the full range of GNUInstallDirs3 years ago
fix: vector gcptr7 days ago
[mlir] Fix building CRunnerUtils on OpenBSD with 15.x3 years ago
[Libomptarget] Revert changes to AMDGPU plugin destructors3 years ago
Exclude check-polly-unittests and check-polly-isl from check-all3 years ago
[libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions3 years ago
[runtimes] Use a response file for runtimes test suites3 years ago
Ensure newlines at the end of files (NFC)4 years ago
Bump version to 15.0.43 years ago
Add modern arc config for default "onto" branch5 years ago
PR46997: don't run clang-format on clang's testcases.5 years ago
Revert "Title: [RISCV] Add missing part of instruction vmsge {u}. VX Review By: craig.topper Differential Revision : https://reviews.llvm.org/D100115"5 years ago
[clangd] Cleanup of readability-identifier-naming4 years ago
Add __config formatting to .git-blame-ignore-revs3 years ago
[llvm] Ignore .rej files in .gitignore4 years ago
.mailmap: remove stray space in comment4 years ago
docs: update some bug tracker references (NFC)4 years ago
Init project.10 months ago
Fix grammar and punctuation across several docs; NFC4 years ago
[docs] Describe reporting security issues on the chromium tracker.4 years ago

LLVM 编译器基础设施

本目录及其子目录包含 LLVM 的源代码,这是一个用于构建高度优化的编译器、优化器和运行时环境的工具包。

本 README 简要介绍了如何开始构建 LLVM。如需了解如何为 LLVM 项目做出贡献,请参阅 LLVM 贡献指南

LLVM 系统入门

内容摘自 LLVM 入门指南

概述

欢迎来到 LLVM 项目!

LLVM 项目包含多个组件。其核心部分名为 "LLVM",包含了处理中间表示并将其转换为目标文件所需的所有工具、库和头文件。工具包括汇编器、反汇编器、位码分析器和位码优化器,还包含基本的回归测试套件。

类 C 语言使用 Clang 前端。该组件将 C、C++、Objective-C 和 Objective-C++ 代码编译为 LLVM 位码,再通过 LLVM 生成目标文件。

其他组件包括: libc++ C++ 标准库LLD 链接器 等。

获取源代码与构建 LLVM

LLVM 入门文档可能已过时。Clang 入门指南 可能包含更准确的信息。

以下是获取和构建 LLVM 源代码的示例工作流程:

  1. 检出 LLVM(包括相关子项目如 Clang):

    • git clone https://github.com/llvm/llvm-project.git
    • 或在 Windows 上:git clone --config core.autocrlf=false https://github.com/llvm/llvm-project.git
  2. 配置并构建 LLVM 和 Clang:

    • cd llvm-project

    • cmake -S llvm -B build -G <生成器> [选项]

      常用构建系统生成器包括:

      • Ninja --- 生成 Ninja 构建文件(多数 LLVM 开发者使用)
      • Unix Makefiles --- 生成兼容 make 的并行 Makefile
      • Visual Studio --- 生成 Visual Studio 项目和解决方案
      • Xcode --- 生成 Xcode 项目

      常用选项:

      • -DLLVM_ENABLE_PROJECTS='...'-DLLVM_ENABLE_RUNTIMES='...' --- 分号分隔的 LLVM 子项目和运行时列表,可选值包括 clang、libcxx 等
      • -DCMAKE_INSTALL_PREFIX=目录 --- 指定安装路径(默认 /usr/local
      • -DCMAKE_BUILD_TYPE=类型 --- 构建类型(Debug/Release/RelWithDebInfo/MinSizeRel)
      • -DLLVM_ENABLE_ASSERTIONS=On --- 启用断言检查
    • cmake --build build [-- [选项] <目标>] 或直接使用构建系统

      • 默认目标会构建全部 LLVM 组件
      • check-all 目标会运行回归测试
      • 可使用并行构建加速(Ninja 默认并行,make 使用 -j NNN 参数)

更多信息请参阅 CMake 指南

详细配置和编译说明请参考 LLVM 入门指南,源码目录结构请查看 目录布局说明

联系我们

加入 LLVM Discourse 论坛Discord 聊天OFTC 上的 #llvm IRC 频道。

LLVM 项目已采用 行为准则,适用于项目内所有沟通场景。

Introduction

LLVM 项目是一个模块化、可复用的编译器及工具链技术的集合。此fork用于添加仓颉编译器的功能,并支持仓颉编译器项目。

Customize my domain