LLVM 项目是一个模块化、可复用的编译器及工具链技术的集合。此fork用于添加仓颉编译器的功能,并支持仓颉编译器项目。
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: sync dev to main Signed-off-by: weinw <weiningwei@h-partners.com> | 1 个月前 | |
feat: sync dev to main Signed-off-by: weinw <weiningwei@h-partners.com> | 1 个月前 | |
[BOLT] Use Optional::emplace to avoid move assignment. NFC (cherry picked from commit 53113515cdaa19a86e4b807808b7b99dc1c91685) | 3 年前 | |
[clangd] Return earlier when snippet is empty Fixes github.com/clangd/clangd/issues/1216 If the Snippet string is empty, Snippet.front() would trigger a crash. Move the Snippet->empty() check up a few lines to avoid this. Should not break any existing behavior. Differential Revision: https://reviews.llvm.org/D134137 (cherry picked from commit 60528c690a4c334d2a3a2c22eb97af9e67d7a91d) | 3 年前 | |
[clang][Sema] Fix a clang crash with btf_type_tag For the following program, $ cat t.c struct t { int (__attribute__((btf_type_tag("rcu"))) *f)(); int a; }; int foo(struct t *arg) { return arg->a; } Compiling with 'clang -g -O2 -S t.c' will cause a failure like below: clang: /home/yhs/work/llvm-project/clang/lib/Sema/SemaType.cpp:6391: void {anonymous}::DeclaratorLocFiller::VisitParenTypeLoc(clang::ParenTypeLoc): Assertion Chunk.Kind == DeclaratorChunk::Paren' failed. PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: ...... #5 0x00007f89e4280ea5 abort (/lib64/libc.so.6+0x21ea5) #6 0x00007f89e4280d79 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d79) #7 0x00007f89e42a6456 (/lib64/libc.so.6+0x47456) #8 0x00000000045c2596 GetTypeSourceInfoForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0 #9 0x00000000045ccfa5 GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0 ...... The reason of the failure is due to the mismatch of TypeLoc and D.getTypeObject().Kind. For example, the TypeLoc is BTFTagAttributedType 0x88614e0 'int btf_type_tag(rcu)()' sugar |-ParenType 0x8861480 'int ()' sugar | -FunctionNoProtoType 0x8861450 'int ()' cdecl | `-BuiltinType 0x87fd500 'int' while corresponding D.getTypeObject().Kind points to DeclaratorChunk::Paren, and this will cause later assertion. To fix the issue, similar to AttributedTypeLoc, let us skip BTFTagAttributedTypeLoc in GetTypeSourceInfoForDeclarator(). Differential Revision: https://reviews.llvm.org/D136807 | 3 年前 | |
[cmake] Fix missing paren in FindPrefixFromConfig This was in CMake syntax generation, so we didn't catch it eval time. Follow up from D117973 | 3 年前 | |
feat: sync dev to main Signed-off-by: weinw <weiningwei@h-partners.com> | 1 个月前 | |
Pretty printer test fixes | 3 年前 | |
[DOCS] Minor fixes and removals of WIP warnings | 3 年前 | |
[libc] Use nearest_integer instructions to improve expm1f performance. Use nearest_integer instructions to improve expf performance. Performance tests with CORE-MATH's perf tool: Before the patch: $ ./perf.sh expm1f LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a GNU libc version: 2.31 GNU libc release: stable CORE-MATH reciprocal throughput : 10.096 System LIBC reciprocal throughput : 44.036 LIBC reciprocal throughput : 11.575 $ ./perf.sh expm1f --latency LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a GNU libc version: 2.31 GNU libc release: stable CORE-MATH latency : 42.239 System LIBC latency : 122.815 LIBC latency : 50.122 After the patch: $ ./perf.sh expm1f LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a GNU libc version: 2.31 GNU libc release: stable CORE-MATH reciprocal throughput : 10.046 System LIBC reciprocal throughput : 43.899 LIBC reciprocal throughput : 9.179 $ ./perf.sh expm1f --latency LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a GNU libc version: 2.31 GNU libc release: stable CORE-MATH latency : 42.078 System LIBC latency : 120.488 LIBC latency : 41.528 Reviewed By: zimmermann6 Differential Revision: https://reviews.llvm.org/D130502 | 3 年前 | |
Remove references to old mailing lists that have moved to discourse. Replace with links to discourse. Reviewed By: #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D129675 | 3 年前 | |
Bump version to 15.0.4 | 3 年前 | |
Remove references to old mailing lists that have moved to discourse. Replace with links to discourse. Reviewed By: #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D129675 | 3 年前 | |
[libunwind][SystemZ] Use process_vm_readv to avoid potential segfaults Fix potential crashes during unwind when checking for signal frames and the current PC is invalid. The same bug was fixed for aarch64 in https://reviews.llvm.org/D126343. Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D129856 | 3 年前 | |
fix: delete useless warning Signed-off-by: jinbohang <jinbohang1@huawei.com> | 29 天前 | |
chore: update version to 1.2.0-beta.rc Co-authored-by: zichexuelan<sundaiyue@foxmail.com> | 6 天前 | |
[cmake] Slight fix ups to make robust to the full range of GNUInstallDirs See https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html#result-variables for CMAKE_INSTALL_FULL_* Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D130545 | 3 年前 | |
!564 merge fix_code_mode into main fix: fix support code model Created-by: weixin_44724691 Commit-by: jinbohang Merged-by: CangjiePL Description: # llvm-project仓PR信息 ## 变更内容**(必填)** 开启 iOS AArch64 large code model 后, AArch64TargetLowering::LowerCall 把 cjc 占位 sentinel callee(CJ_MCC_StackCheck / GetGCPhase / GetCJThreadIdForMutexOpt / SetDebugLocation)物化成 LOADgot + BLR,使 AsmPrinter 按符号名拦截改内联的机制(要求 operand0 为 GlobalAddress)miss,导致: 1. 链接 stdlib 的 libcangjie-std-*.dylib 时报 undefined symbol(runtime 不导出这些纯 sentinel); 2. 正确性 bug:内联版产出 x9,而真调用返回值落 x0,后续 cmp w9 用错寄存器。 修复: - AArch64ISelLowering.cpp:复用已有 safepoint 的 MO_NO_FLAG 豁免先例,把纯 sentinel 加入列表,保持直符号 BL @sym,AsmPrinter 拦截恢复内联,无 LOADgot、无符号引用。 - AArch64AsmPrinter.cpp:emitCJNewArrayFastPath 按 MachineOperand 类型选 BL/BLR,寄存器型 call target 走 BLR。 小代码模型下 MO_NO_FLAG 为 no-op,不影响 darwin 等原生构建。 ## 变更类型**(必填)** 请描述本次Pull Request变更类型(原因),**请在对应类型的括号内填写Y**: - 新增需求( ) - 问题修复(Y) - 构建过程或辅助工具变动() - 文档更新() ## 变更内容自检 ### 编译器及标准库编译通过截图证明(如涉及新增需求、问题修复、构建过程变动需提供) 请分别提供此Pull Request在你本地环境中的编译器及标准库编译成功截图。 > 已本地增量重编 cjc(重编 AArch64ISelLowering.cpp + AArch64AsmPrinter.cpp + relink)并重跑 stdlib,各 libcangjie-std-*.dylib 链接通过。截图待补。 ### 测试用例本地自验证通过截图证明(如涉及新增需求、问题修复需提供)  > 验证方法(三者均应为空): > bash > llc std.opt.bc -mtriple=arm64-apple-ios14.0.0-simulator -code-model=large -stop-after=finalize-isel -o - \ > | grep -E "LOADgot.*(CJ_MCC_StackCheck|GetGCPhase|GetCJThreadIdForMutexOpt)" > grep -cE "(CJ_MCC_StackCheck|GetGCPhase|GetCJThreadIdForMutexOpt)@GOTPAGE" <.../*.s> > nm <.../*.o> | grep -E "GetGCPhase|GetCJThreadIdForMutexOpt|CJ_MCC_StackCheck" > > 截图待补。  ### 其他信息 - 关联 issue: https://gitcode.com/Cangjie/llvm-project/issues/170 - 仅影响 iOS AArch64 large code model;小代码模型构建无变化。 - SetDebugLocation 为防御性加入(release 不引用,debug 才会)。 See merge request: Cangjie/llvm-project!564 | 20 小时前 | |
[mlir] Fix building CRunnerUtils on OpenBSD with 15.x CRunnerUtils builds as C++11. 9c1d133c3a0256cce7f40e2e06966f84e8b99ffe broke the build on OpenBSD. aligned_alloc() was only introduced in C++17. | 3 年前 | |
[Libomptarget] Revert changes to AMDGPU plugin destructors These patches exposed a lot of problems in the AMD toolchain. Rather than keep it broken we should revert it to its old semi-functional state. This will prevent us from using device destructors but should remove some new bugs. In the future this interface should be changed once these problems are addressed more correctly. This reverts commit ed0f21811544320f829124efbb6a38ee12eb9155. This reverts commit 2b7203a35972e98b8521f92d2791043dc539ae88. Fixes #57536 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D133997 | 3 年前 | |
Exclude check-polly-unittests and check-polly-isl from check-all The unittests are already included in check-polly, so check-all was running them twice. Running them twice causes a race on the output files, which led to intermittent failures on the reverse-iteration buildbot. (cherry picked from commit 2c29268bfcc84c3b94bcb0aa34b7ef9c9bd9af01) | 3 年前 | |
[libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions Reviewed By: ldionne, #libc Spies: jwakely, rodgert, libcxx-commits Differential Revision: https://reviews.llvm.org/D125634 | 4 年前 | |
[runtimes] Use a response file for runtimes test suites We don't know which test suites are going to be included by runtimes builds so we cannot include those before running the sub-build, but that's not possible during the LLVM build configuration. We instead use a response file that's populated by the runtimes build as a level of indirection. This addresses the issue described in: https://discourse.llvm.org/t/cmake-regeneration-is-broken/62788 Differential Revision: https://reviews.llvm.org/D132438 (cherry picked from commit 992e10a3fce41255e4b11782f51d0f4b26dca14d) | 3 年前 | |
Ensure newlines at the end of files (NFC) | 4 年前 | |
Bump version to 15.0.4 | 3 年前 | |
Add modern arc config for default "onto" branch The config option for this changed in https://secure.phabricator.com/D21313 (or when that was rolled out). I'm leaving the old config option, which may be in use by people with older versions of arc. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D97215 | 5 年前 | |
PR46997: don't run clang-format on clang's testcases. The formatting of the testcases matters and shouldn't be overwritten by a tool. | 5 年前 | |
Revert "Title: [RISCV] Add missing part of instruction vmsge {u}. VX Review By: craig.topper Differential Revision : https://reviews.llvm.org/D100115" This reverts commit 4d9ccb18f50803a1aa9c0332dc72472bdfec8bc4. | 5 年前 | |
[clangd] Cleanup of readability-identifier-naming Auto-generated patch based on clang-tidy readability-identifier-naming. Only some manual cleanup for extern "C" declarations and a GTest change was required. I'm not sure if this cleanup is actually very useful. It cleans up clang-tidy findings to the number of warnings from clang-tidy should be lower. Since it was easy to do and required only little cleanup I thought I'd upload it for discussion. One pattern that keeps recurring: Test **matchers** are also supposed to start with a lowercase letter as per LLVM convention. However GTest naming convention for matchers start with upper case. I would propose to keep stay consistent with the GTest convention there. However that would imply a lot of //NOLINT throughout these files. To re-product this patch run: run-clang-tidy -checks="-*,readability-identifier-naming" -fix -format ./clang-tools-extra/clangd To convert the macro names, I was using this script with some manual cleanup afterwards: https://gist.github.com/ChristianKuehnel/a01cc4362b07c58281554ab46235a077 Differential Revision: https://reviews.llvm.org/D115634 | 4 年前 | |
Add __config formatting to .git-blame-ignore-revs | 4 年前 | |
[llvm] Ignore .rej files in .gitignore Ignore reject files (.rej) files generated by patch. I can't imagine a reason they should ever be checked in. I considered ignoring patch files as well but decided to err on the side of caution because we might not want them to be easily deleted by something like git clean. Differential revision: https://reviews.llvm.org/D124619 | 4 年前 | |
.mailmap: remove stray space in comment | 4 年前 | |
docs: update some bug tracker references (NFC) Fixes https://github.com/llvm/llvm-project/issues/53091 Differential Revision: https://reviews.llvm.org/D116898 | 4 年前 | |
Init project. | 11 个月前 | |
Fix grammar and punctuation across several docs; NFC | 4 年前 | |
[docs] Describe reporting security issues on the chromium tracker. To track security issues, we're starting with the chromium bug tracker (using the llvm project there). We considered using Github Security Advisories. However, they are currently intended as a way for project owners to publicize their security advisories, and aren't well-suited to reporting issues. This also moves the issue-reporting paragraph to the beginning of the document, in part to make it more discoverable, in part to allow the anchor-linking to actually display the paragraph at the top of the page. Note that this doesn't update the concrete list of security-sensitive areas, which is still an open item. When we do, we may want to move the list of security-sensitive areas next to the issue-reporting paragraph as well, as it seems like relevant information needed in the reporting process. Finally, when describing the discission medium, this splits the topics discussed into two: the concrete security issues, discussed in the issue tracker, and the logistics of the group, in our mailing list, as patches on public lists, and in the monthly sync-up call. While there, add a SECURITY.md page linking to the relevant paragraph. Differential Revision: https://reviews.llvm.org/D100873 | 5 年前 |
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 源代码的示例工作流程:
-
检出 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
-
配置并构建 LLVM 和 Clang:
-
cd llvm-project -
cmake -S llvm -B build -G <生成器> [选项]常用构建系统生成器包括:
Ninja--- 生成 Ninja 构建文件(多数 LLVM 开发者使用)Unix Makefiles--- 生成兼容 make 的并行 MakefileVisual 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 项目已采用 行为准则,适用于项目内所有沟通场景。