Skip to content

Commit 474faeb

Browse files
committed
Merge from 'main' to 'sycl-web' (181 commits)
CONFLICT (content): Merge conflict in llvm/lib/Passes/PassBuilderPipelines.cpp
2 parents 0a1f3c7 + 895cda7 commit 474faeb

File tree

1,532 files changed

+24520
-13967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,532 files changed

+24520
-13967
lines changed

.github/workflows/gha-codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Actions CodeQL
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '30 0 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
codeql:
19+
name: 'Github Actions CodeQL'
20+
runs-on: ubuntu-24.04
21+
permissions:
22+
security-events: write
23+
steps:
24+
- name: Checkout LLVM
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
sparse-checkout: |
28+
.github/
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
31+
with:
32+
languages: actions
33+
queries: security-extended
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3

bolt/lib/Core/BinaryContext.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "llvm/MC/MCSymbol.h"
3434
#include "llvm/Support/CommandLine.h"
3535
#include "llvm/Support/Error.h"
36+
#include "llvm/Support/FileSystem.h"
3637
#include "llvm/Support/Regex.h"
3738
#include <algorithm>
3839
#include <functional>
@@ -1632,19 +1633,29 @@ void BinaryContext::preprocessDWODebugInfo() {
16321633
DwarfUnit->getUnitDIE().find(
16331634
{dwarf::DW_AT_dwo_name, dwarf::DW_AT_GNU_dwo_name}),
16341635
"");
1635-
SmallString<16> AbsolutePath;
1636+
SmallString<16> AbsolutePath(DWOName);
1637+
std::string DWOCompDir = DwarfUnit->getCompilationDir();
16361638
if (!opts::CompDirOverride.empty()) {
1637-
sys::path::append(AbsolutePath, opts::CompDirOverride);
1638-
sys::path::append(AbsolutePath, DWOName);
1639+
DWOCompDir = opts::CompDirOverride;
1640+
} else if (!sys::fs::exists(DWOCompDir) && sys::fs::exists(DWOName)) {
1641+
DWOCompDir = ".";
1642+
this->outs()
1643+
<< "BOLT-WARNING: Debug Fission: Debug Compilation Directory of "
1644+
<< DWOName
1645+
<< " does not exist. Relative path will be used to process .dwo "
1646+
"files.\n";
16391647
}
1648+
// Prevent failures when DWOName is already an absolute path.
1649+
sys::fs::make_absolute(DWOCompDir, AbsolutePath);
16401650
DWARFUnit *DWOCU =
16411651
DwarfUnit->getNonSkeletonUnitDIE(false, AbsolutePath).getDwarfUnit();
16421652
if (!DWOCU->isDWOUnit()) {
16431653
this->outs()
16441654
<< "BOLT-WARNING: Debug Fission: DWO debug information for "
16451655
<< DWOName
16461656
<< " was not retrieved and won't be updated. Please check "
1647-
"relative path.\n";
1657+
"relative path or use '--comp-dir-override' to specify the base "
1658+
"location.\n";
16481659
continue;
16491660
}
16501661
DWOCUs[*DWOId] = DWOCU;

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,15 +1846,16 @@ void DWARFRewriter::writeDWOFiles(
18461846
}
18471847

18481848
std::string CompDir = CU.getCompilationDir();
1849+
SmallString<16> AbsolutePath(DWOName);
18491850

18501851
if (!opts::DwarfOutputPath.empty())
18511852
CompDir = opts::DwarfOutputPath.c_str();
18521853
else if (!opts::CompDirOverride.empty())
18531854
CompDir = opts::CompDirOverride;
1854-
1855-
SmallString<16> AbsolutePath;
1856-
sys::path::append(AbsolutePath, CompDir);
1857-
sys::path::append(AbsolutePath, DWOName);
1855+
else if (!sys::fs::exists(CompDir))
1856+
CompDir = ".";
1857+
// Prevent failures when DWOName is already an absolute path.
1858+
sys::fs::make_absolute(CompDir, AbsolutePath);
18581859

18591860
std::error_code EC;
18601861
std::unique_ptr<ToolOutputFile> TempOut =

bolt/test/dwo-name-retrieving.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Test DWO retrieval via relative path with a missing CompDir.
2+
## Also, verify no crash for an absolute DWOName path.
3+
4+
## The case where DWOName is a relative path, and debug compilation directory does not exist.
5+
# RUN: rm -rf %t && mkdir -p %t && cd %t
6+
# RUN: %clang %cflags -g -gsplit-dwarf -fdebug-compilation-dir=/path/does/not/exist %p/Inputs/hello.c -o main.exe
7+
# RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s -check-prefix=DWO-NAME-REL
8+
9+
# DWO-NAME-REL: BOLT-WARNING: Debug Fission: Debug Compilation Directory of main.exe-hello.dwo does not exist.
10+
# DWO-NAME-REL-NOT: Debug Fission: DWO debug information for
11+
12+
## The case where DWOName is a absolute path, and a dwp file is provided.
13+
# RUN: %clang %cflags -g -gsplit-dwarf %p/Inputs/hello.c -o %t/main.exe
14+
# RUN: llvm-dwp -e %t/main.exe -o %t/main.exe.dwp
15+
# RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections -dwp=%t/main.exe.dwp 2>&1 | FileCheck %s -check-prefix=DWO-NAME-ABS
16+
17+
# DWO-NAME-ABS-NOT: BOLT-WARNING: Debug Fission: Debug Compilation Directory of {{.*}}/main.exe-hello.dwo does not exist.
18+
# DWO-NAME-ABS-NOT: Debug Fission: DWO debug information for
19+
# DWO-NAME-ABS-NOT: Assertion `FD >= 0 && "File not yet open!"' failed.

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- tools/extra/clang-tidy/ClangTidy.cpp - Clang tidy tool -----------===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/clang-tidy/ClangTidy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ClangTidy.h - clang-tidy -------------------------------*- C++ -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/clang-tidy/ClangTidyCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ClangTidyCheck.cpp - clang-tidy ------------------------*- C++ -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/clang-tidy/ClangTidyCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ClangTidyCheck.h - clang-tidy --------------------------*- C++ -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- tools/extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp ----------=== //
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ClangTidyDiagnosticConsumer.h - clang-tidy -------------*- C++ -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

0 commit comments

Comments
 (0)