Skip to content

Commit 2038f8d

Browse files
committed
Merge branch 'main' into pauth-gnuprop-clang
2 parents 2fd8f66 + 4e0b8ea commit 2038f8d

File tree

2,444 files changed

+107749
-51432
lines changed

Some content is hidden

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

2,444 files changed

+107749
-51432
lines changed

.ci/monolithic-linux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set -o pipefail
1818

1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
rm -rf ${BUILD_DIR}
21+
rm -rf "${BUILD_DIR}"
2222

2323
ccache --zero-stats
2424

@@ -37,8 +37,8 @@ projects="${1}"
3737
targets="${2}"
3838

3939
echo "--- cmake"
40-
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41-
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
40+
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
41+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4242
-D LLVM_ENABLE_PROJECTS="${projects}" \
4343
-G Ninja \
4444
-D CMAKE_BUILD_TYPE=Release \

.ci/monolithic-windows.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -o pipefail
1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2121

22-
rm -rf ${BUILD_DIR}
22+
rm -rf "${BUILD_DIR}"
2323

2424
if [[ -n "${CLEAR_CACHE:-}" ]]; then
2525
echo "clearing sccache"
@@ -37,14 +37,14 @@ projects="${1}"
3737
targets="${2}"
3838

3939
echo "--- cmake"
40-
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
40+
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
4141

4242
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
4343
# on fixing a build reliability issue on the build server, please
4444
# see https://github.com/llvm/llvm-project/pull/82393 and
4545
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
4646
# for further information.
47-
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
47+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4848
-D LLVM_ENABLE_PROJECTS="${projects}" \
4949
-G Ninja \
5050
-D CMAKE_BUILD_TYPE=Release \

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,6 @@ clang/test/AST/Interp/ @tbaederr
125125
/llvm/**/TextAPI/ @cyndyishida
126126
/clang/**/InstallAPI/ @cyndyishida
127127
/clang/tools/clang-installapi/ @cyndyishida
128+
129+
# ExtractAPI
130+
/clang/**/ExtractAPI @daniel-grumberg

.github/workflows/email-check.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Check for private emails used in PRs"
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- opened
77

@@ -10,8 +10,6 @@ permissions:
1010

1111
jobs:
1212
validate_email:
13-
permissions:
14-
pull-requests: write
1513
runs-on: ubuntu-latest
1614
if: github.repository == 'llvm/llvm-project'
1715
steps:
@@ -25,20 +23,24 @@ jobs:
2523
run: |
2624
git log -1
2725
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
26+
# Create empty comment file
27+
echo "[]" > comments
2828
2929
- name: Validate author email
3030
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
31-
uses: actions/github-script@v6
3231
env:
33-
EMAIL: ${{ steps.author.outputs.EMAIL }}
32+
COMMENT: >-
33+
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
34+
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35+
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
36+
run: |
37+
cat << EOF > comments
38+
[{"body" : "$COMMENT"}]
39+
EOF
40+
41+
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
42+
if: always()
3443
with:
35-
script: |
36-
const { EMAIL } = process.env
37-
await github.rest.issues.createComment({
38-
issue_number: context.issue.number,
39-
owner: context.repo.owner,
40-
repo: context.repo.repo,
41-
body: `⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
42-
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
43-
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
44-
`})
44+
name: workflow-args
45+
path: |
46+
comments

.github/workflows/issue-write.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Comment on an issue
22

33
on:
44
workflow_run:
5-
workflows: ["Check code formatting"]
5+
workflows:
6+
- "Check code formatting"
7+
- "Check for private emails used in PRs"
68
types:
79
- completed
810

@@ -31,7 +33,7 @@ jobs:
3133
script: |
3234
var fs = require('fs');
3335
const comments = JSON.parse(fs.readFileSync('./comments'));
34-
if (!comments) {
36+
if (!comments || comments.length == 0) {
3537
return;
3638
}
3739
@@ -77,6 +79,15 @@ jobs:
7779
}
7880
const gql_result = await github.graphql(gql_query, gql_variables);
7981
console.log(gql_result);
82+
// If the branch for the PR was deleted before this job has a chance
83+
// to run, then the ref will be null. This can happen if someone:
84+
// 1. Rebase the PR, which triggers some workflow.
85+
// 2. Immediately merges the PR and deletes the branch.
86+
// 3. The workflow finishes and triggers this job.
87+
if (!gql_result.repository.ref) {
88+
console.log("Ref has been deleted");
89+
return;
90+
}
8091
console.log(gql_result.repository.ref.associatedPullRequests.nodes);
8192
8293
var pr_number = 0;

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Fetch code formatting utils
3434
uses: actions/checkout@v4
3535
with:
36-
reository: ${{ github.repository }}
36+
repository: ${{ github.repository }}
3737
ref: ${{ github.base_ref }}
3838
sparse-checkout: |
3939
llvm/utils/git/requirements_formatting.txt

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
persist-credentials: false
3737

3838
- name: "Run analysis"
39-
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
39+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
4040
with:
4141
results_file: results.sarif
4242
results_format: sarif

bolt/include/bolt/Core/AddressMap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef BOLT_CORE_ADDRESS_MAP_H
1515
#define BOLT_CORE_ADDRESS_MAP_H
1616

17-
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/MC/MCSymbol.h"
1918

2019
#include <optional>

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ class BinaryContext {
265265

266266
public:
267267
static Expected<std::unique_ptr<BinaryContext>>
268-
createBinaryContext(const ObjectFile *File, bool IsPIC,
268+
createBinaryContext(Triple TheTriple, StringRef InputFileName,
269+
SubtargetFeatures *Features, bool IsPIC,
269270
std::unique_ptr<DWARFContext> DwCtx,
270271
JournalingStreams Logger);
271272

bolt/include/bolt/Core/BinaryData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/ADT/Twine.h"
1919
#include "llvm/MC/MCSymbol.h"
2020
#include "llvm/Support/raw_ostream.h"
21-
#include <algorithm>
2221
#include <string>
2322
#include <vector>
2423

bolt/include/bolt/Core/BinaryDomTree.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "bolt/Core/BinaryBasicBlock.h"
1818
#include "llvm/IR/Dominators.h"
19-
#include "llvm/Support/GenericDomTreeConstruction.h"
2019

2120
namespace llvm {
2221
namespace bolt {

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "bolt/Core/BinaryBasicBlock.h"
2929
#include "bolt/Core/BinaryContext.h"
30+
#include "bolt/Core/BinaryDomTree.h"
3031
#include "bolt/Core/BinaryLoop.h"
3132
#include "bolt/Core/BinarySection.h"
3233
#include "bolt/Core/DebugData.h"
@@ -51,7 +52,6 @@
5152
#include <iterator>
5253
#include <limits>
5354
#include <unordered_map>
54-
#include <unordered_set>
5555
#include <utility>
5656
#include <vector>
5757

@@ -266,6 +266,7 @@ class BinaryFunction {
266266
BinaryContext &BC;
267267

268268
std::unique_ptr<BinaryLoopInfo> BLI;
269+
std::unique_ptr<BinaryDominatorTree> BDT;
269270

270271
/// All labels in the function that are referenced via relocations from
271272
/// data objects. Typically these are jump table destinations and computed
@@ -838,6 +839,14 @@ class BinaryFunction {
838839
/// stats.
839840
void calculateMacroOpFusionStats();
840841

842+
/// Returns if BinaryDominatorTree has been constructed for this function.
843+
bool hasDomTree() const { return BDT != nullptr; }
844+
845+
BinaryDominatorTree &getDomTree() { return *BDT.get(); }
846+
847+
/// Constructs DomTree for this function.
848+
void constructDomTree();
849+
841850
/// Returns if loop detection has been run for this function.
842851
bool hasLoopInfo() const { return BLI != nullptr; }
843852

@@ -1159,7 +1168,7 @@ class BinaryFunction {
11591168
/// Pass an offset of the entry point in the input binary and a corresponding
11601169
/// global symbol to the callback function.
11611170
///
1162-
/// Return true of all callbacks returned true, false otherwise.
1171+
/// Return true if all callbacks returned true, false otherwise.
11631172
bool forEachEntryPoint(EntryPointCallbackTy Callback) const;
11641173

11651174
/// Return MC symbol associated with the end of the function.

bolt/include/bolt/Core/BinaryLoop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef BOLT_CORE_BINARY_LOOP_H
1616
#define BOLT_CORE_BINARY_LOOP_H
1717

18-
#include "llvm/Support/GenericLoopInfoImpl.h"
18+
#include "llvm/Support/GenericLoopInfo.h"
1919

2020
namespace llvm {
2121
namespace bolt {

bolt/include/bolt/Core/BinarySection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "bolt/Core/DebugData.h"
1919
#include "bolt/Core/Relocation.h"
2020
#include "llvm/ADT/ArrayRef.h"
21-
#include "llvm/ADT/STLExtras.h"
2221
#include "llvm/BinaryFormat/ELF.h"
2322
#include "llvm/Object/ELFObjectFile.h"
2423
#include "llvm/Object/MachO.h"

bolt/include/bolt/Core/DebugData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <mutex>
2828
#include <string>
2929
#include <unordered_map>
30-
#include <unordered_set>
3130
#include <utility>
3231
#include <vector>
3332

bolt/include/bolt/Core/DebugNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef BOLT_CORE_DEBUG_NAMES_H
1515
#define BOLT_CORE_DEBUG_NAMES_H
1616

17-
#include "DebugData.h"
17+
#include "bolt/Core/DebugData.h"
1818
#include "llvm/CodeGen/AccelTable.h"
1919

2020
namespace llvm {

bolt/include/bolt/Core/FunctionLayout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "llvm/ADT/iterator.h"
2626
#include "llvm/ADT/iterator_range.h"
2727
#include <iterator>
28-
#include <utility>
2928

3029
namespace llvm {
3130
namespace bolt {

bolt/include/bolt/Core/MCPlus.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
#ifndef BOLT_CORE_MCPLUS_H
1515
#define BOLT_CORE_MCPLUS_H
1616

17-
#include "llvm/CodeGen/TargetOpcodes.h"
1817
#include "llvm/MC/MCExpr.h"
1918
#include "llvm/MC/MCInst.h"
20-
#include "llvm/Support/Casting.h"
2119
#include <vector>
2220

2321
namespace llvm {

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/ADT/ArrayRef.h"
2020
#include "llvm/ADT/BitVector.h"
2121
#include "llvm/ADT/StringMap.h"
22+
#include "llvm/CodeGen/TargetOpcodes.h"
2223
#include "llvm/MC/MCAsmBackend.h"
2324
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
2425
#include "llvm/MC/MCExpr.h"
@@ -27,6 +28,7 @@
2728
#include "llvm/MC/MCInstrDesc.h"
2829
#include "llvm/MC/MCInstrInfo.h"
2930
#include "llvm/Support/Allocator.h"
31+
#include "llvm/Support/Casting.h"
3032
#include "llvm/Support/ErrorHandling.h"
3133
#include "llvm/Support/ErrorOr.h"
3234
#include "llvm/Support/RWMutex.h"
@@ -533,9 +535,7 @@ class MCPlusBuilder {
533535
return Analysis->isReturn(Inst);
534536
}
535537

536-
virtual bool isTerminator(const MCInst &Inst) const {
537-
return Analysis->isTerminator(Inst);
538-
}
538+
virtual bool isTerminator(const MCInst &Inst) const;
539539

540540
virtual bool isNoop(const MCInst &Inst) const {
541541
llvm_unreachable("not implemented");

bolt/include/bolt/Passes/BinaryPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "bolt/Core/DynoStats.h"
1919
#include "llvm/Support/CommandLine.h"
2020
#include <atomic>
21-
#include <map>
2221
#include <set>
2322
#include <string>
2423
#include <unordered_set>

bolt/include/bolt/Passes/CacheMetrics.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef BOLT_PASSES_CACHEMETRICS_H
1414
#define BOLT_PASSES_CACHEMETRICS_H
1515

16-
#include <cstdint>
1716
#include <vector>
1817

1918
namespace llvm {

bolt/include/bolt/Passes/DominatorAnalysis.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "llvm/Support/CommandLine.h"
14-
#include "llvm/Support/Timer.h"
1514

1615
namespace opts {
1716
extern llvm::cl::opt<bool> TimeOpts;

bolt/include/bolt/Passes/ReachingDefOrUse.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "bolt/Passes/RegAnalysis.h"
14-
#include "llvm/MC/MCRegisterInfo.h"
1514
#include "llvm/Support/CommandLine.h"
16-
#include "llvm/Support/Timer.h"
1715
#include <optional>
1816

1917
namespace opts {

bolt/include/bolt/Passes/ReachingInsns.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "bolt/Passes/DataflowAnalysis.h"
1313
#include "llvm/Support/CommandLine.h"
14-
#include "llvm/Support/Timer.h"
1514

1615
namespace opts {
1716
extern llvm::cl::opt<bool> TimeOpts;

bolt/include/bolt/Passes/ReorderUtils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef BOLT_PASSES_REORDER_UTILS_H
1515
#define BOLT_PASSES_REORDER_UTILS_H
1616

17-
#include <memory>
1817
#include <vector>
1918

2019
#include "llvm/ADT/BitVector.h"

bolt/include/bolt/Profile/ProfileReaderBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ProfileReaderBase {
6565
/// Return true if the function \p BF may have a profile available.
6666
/// The result is based on the name(s) of the function alone and the profile
6767
/// match is not guaranteed.
68-
virtual bool mayHaveProfileData(const BinaryFunction &BF);
68+
virtual bool mayHaveProfileData(const BinaryFunction &BF) { return true; }
6969

7070
/// Return true if the profile contains an entry for a local object
7171
/// that has an associated file name.

bolt/include/bolt/Profile/ProfileYAMLMapping.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define BOLT_PROFILE_PROFILEYAMLMAPPING_H
1515

1616
#include "bolt/Core/BinaryFunction.h"
17-
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/Support/YAMLTraits.h"
1918
#include <vector>
2019

0 commit comments

Comments
 (0)