Skip to content

Commit 709e792

Browse files
authored
Merge branch 'main' into compressinst
2 parents ad5d383 + e9330fd commit 709e792

File tree

472 files changed

+13629
-6321
lines changed

Some content is hidden

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

472 files changed

+13629
-6321
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ jobs:
281281
- name: Set up the MSVC dev environment
282282
if: ${{ matrix.mingw != true }}
283283
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
284+
- name: Add the installed Clang at the start of the path
285+
if: ${{ matrix.mingw != true }}
286+
run: |
287+
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
284288
- name: Build and test
285289
run: |
286290
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

bolt/utils/dot2html/d3-graphviz-template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
33
<body>
4-
<script src="https://d3js.org/d3.v5.min.js"></script>
5-
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
6-
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
4+
<script src="https://d3js.org/d3.v7.min.js"></script>
5+
<script src="https://unpkg.com/@hpcc-js/wasm@2.20.0/dist/graphviz.umd.js"></script>
6+
<script src="https://unpkg.com/d3-graphviz@5.6.0/build/d3-graphviz.js"></script>
77
<div id="graph" style="text-align: center;"></div>
88
<script>
99
var dotSrc = `

clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ static constexpr int UnsignedASCIIUpperBound = 127;
2121
SignedCharMisuseCheck::SignedCharMisuseCheck(StringRef Name,
2222
ClangTidyContext *Context)
2323
: ClangTidyCheck(Name, Context),
24-
CharTypdefsToIgnoreList(Options.get("CharTypdefsToIgnore", "")),
24+
CharTypedefsToIgnoreList(Options.get("CharTypedefsToIgnore", "")),
2525
DiagnoseSignedUnsignedCharComparisons(
2626
Options.get("DiagnoseSignedUnsignedCharComparisons", true)) {}
2727

2828
void SignedCharMisuseCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
29-
Options.store(Opts, "CharTypdefsToIgnore", CharTypdefsToIgnoreList);
29+
Options.store(Opts, "CharTypedefsToIgnore", CharTypedefsToIgnoreList);
3030
Options.store(Opts, "DiagnoseSignedUnsignedCharComparisons",
3131
DiagnoseSignedUnsignedCharComparisons);
3232
}
@@ -39,7 +39,7 @@ BindableMatcher<clang::Stmt> SignedCharMisuseCheck::charCastExpression(
3939
// (e.g. typedef char sal_Int8). In this case, we don't need to
4040
// worry about the misinterpretation of char values.
4141
const auto IntTypedef = qualType(hasDeclaration(typedefDecl(
42-
hasAnyName(utils::options::parseStringList(CharTypdefsToIgnoreList)))));
42+
hasAnyName(utils::options::parseStringList(CharTypedefsToIgnoreList)))));
4343

4444
auto CharTypeExpr = expr();
4545
if (IsSigned) {

clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SignedCharMisuseCheck : public ClangTidyCheck {
3535
const ast_matchers::internal::Matcher<clang::QualType> &IntegerType,
3636
const std::string &CastBindName) const;
3737

38-
const StringRef CharTypdefsToIgnoreList;
38+
const StringRef CharTypedefsToIgnoreList;
3939
const bool DiagnoseSignedUnsignedCharComparisons;
4040
};
4141

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ Potentially Breaking Changes
5454
:program:`clang-tidy-20`. Users should use the check-specific options of the
5555
same name instead.
5656

57-
- Renamed :program:`clang-tidy`'s option name of check
58-
:doc:`bugprone-easily-swappable-parameters
59-
<clang-tidy/checks/bugprone/easily-swappable-parameters>` from
60-
``NamePrefixSuffixSilenceDissimilarityTreshold`` to
61-
``NamePrefixSuffixSilenceDissimilarityThreshold``,
62-
correcting a spelling mistake.
57+
- Renamed a few :program:`clang-tidy` check options, as they
58+
were misspelled:
59+
60+
- `NamePrefixSuffixSilenceDissimilarityTreshold` to
61+
`NamePrefixSuffixSilenceDissimilarityThreshold` in
62+
:doc:`bugprone-easily-swappable-parameters
63+
<clang-tidy/checks/bugprone/easily-swappable-parameters>`
64+
65+
- `CharTypdefsToIgnore` to `CharTypedefsToIgnore` in
66+
:doc:`bugprone-signed-char-misuse
67+
<clang-tidy/checks/bugprone/signed-char-misuse>`
6368

6469
Improvements to clangd
6570
----------------------

clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ so both arguments will have the same type.
107107
Options
108108
-------
109109

110-
.. option:: CharTypdefsToIgnore
110+
.. option:: CharTypedefsToIgnore
111111

112112
A semicolon-separated list of typedef names. In this list, we can list
113113
typedefs for ``char`` or ``signed char``, which will be ignored by the

clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-signed-char-misuse %t \
22
// RUN: -config='{CheckOptions: \
3-
// RUN: {bugprone-signed-char-misuse.CharTypdefsToIgnore: "sal_Int8;int8_t"}}' \
3+
// RUN: {bugprone-signed-char-misuse.CharTypedefsToIgnore: "sal_Int8;int8_t"}}' \
44
// RUN: --
55

66
///////////////////////////////////////////////////////////////////

clang/docs/analyzer/developer-docs/DebugChecks.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ The analyzer contains a number of checkers which can aid in debugging. Enable
99
them by using the "-analyzer-checker=" flag, followed by the name of the
1010
checker.
1111

12+
These checkers are especially useful when analyzing a specific function, using
13+
the `-analyze-function` flag. The flag accepts the function name for C code,
14+
like `-analyze-function=myfunction`.
15+
For C++ code, due to overloading, the function name must include the
16+
parameter list, like `-analyze-function="myfunction(int, _Bool)"`.
17+
18+
Note that `bool` must be spelled as `_Bool` in the parameter list.
19+
Refer to the output of `-analyzer-display-progress` to find the fully qualified
20+
function name.
21+
22+
There are cases when this name can still collide. For example with template
23+
function instances with non-deducible (aka. explicit) template parameters.
24+
In such cases, prefer passing a USR instead of a function name can resolve this
25+
ambiguity, like this: `-analyze-function="c:@S@Window@F@overloaded#I#"`.
26+
27+
Use the `clang-extdef-mapping` tool to find the USR for different functions.
1228

1329
General Analysis Dumpers
1430
========================

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,13 @@ let Features = "sse2", Attributes = [NoThrow] in {
216216
def movnti : X86Builtin<"void(int *, int)">;
217217
}
218218

219-
let Features = "sse2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
220-
def pshufd : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
219+
let Features = "sse2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
221220
def pshuflw : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Constant int)">;
221+
def pshufd : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
222222
def pshufhw : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Constant int)">;
223+
}
224+
225+
let Features = "sse2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
223226
def psadbw128 : X86Builtin<"_Vector<2, long long int>(_Vector<16, char>, _Vector<16, char>)">;
224227
def sqrtpd : X86Builtin<"_Vector<2, double>(_Vector<2, double>)">;
225228
def sqrtsd : X86Builtin<"_Vector<2, double>(_Vector<2, double>)">;
@@ -584,9 +587,6 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
584587
def pmulhrsw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
585588
def psadbw256 : X86Builtin<"_Vector<4, long long int>(_Vector<32, char>, _Vector<32, char>)">;
586589
def pshufb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
587-
def pshufd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
588-
def pshuflw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Constant int)">;
589-
def pshufhw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Constant int)">;
590590
def psignb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
591591
def psignw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
592592
def psignd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>)">;
@@ -647,6 +647,10 @@ let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWi
647647
def packsswb256 : X86Builtin<"_Vector<32, char>(_Vector<16, short>, _Vector<16, short>)">;
648648
def packssdw256 : X86Builtin<"_Vector<16, short>(_Vector<8, int>, _Vector<8, int>)">;
649649
def packuswb256 : X86Builtin<"_Vector<32, char>(_Vector<16, short>, _Vector<16, short>)">;
650+
651+
def pshuflw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Constant int)">;
652+
def pshufhw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Constant int)">;
653+
def pshufd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
650654
}
651655

652656
let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
@@ -1017,6 +1021,7 @@ let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<512>
10171021
let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
10181022
def pmuldq512 : X86Builtin<"_Vector<8, long long int>(_Vector<16, int>, _Vector<16, int>)">;
10191023
def pmuludq512 : X86Builtin<"_Vector<8, long long int>(_Vector<16, int>, _Vector<16, int>)">;
1024+
def pshufd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Constant int)">;
10201025
}
10211026

10221027
let Features = "avx512f", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
@@ -1990,13 +1995,13 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, Constexpr, RequiredVect
19901995
}
19911996

19921997
let Features = "avx512bw", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1993-
def pshufhw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
1994-
def pshuflw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
19951998
def psllw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
19961999
}
19972000

19982001
let Features = "avx512bw", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
19992002
def psllv32hi : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<32, short>)">;
2003+
def pshufhw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
2004+
def pshuflw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
20002005
}
20012006

20022007
let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
@@ -2026,8 +2031,7 @@ let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, Constexpr, Req
20262031
def psrlv8hi : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
20272032
}
20282033

2029-
let Features = "avx512f",
2030-
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
2034+
let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
20312035
def psrlwi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
20322036
def psrldi512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, int)">;
20332037
def psrlqi512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, int)">;
@@ -3266,7 +3270,6 @@ let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<128>
32663270
}
32673271

32683272
let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
3269-
def pshufd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Constant int)">;
32703273
def expanddf512_mask : X86Builtin<"_Vector<8, double>(_Vector<8, double>, _Vector<8, double>, unsigned char)">;
32713274
def expanddi512_mask : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>, unsigned char)">;
32723275
}

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
1111

1212
#include "clang/AST/CharUnits.h"
13+
#include "clang/Basic/AddressSpaces.h"
1314
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
1415
#include "clang/CIR/Dialect/IR/CIRDialect.h"
1516
#include "clang/CIR/Dialect/IR/CIRTypes.h"
@@ -129,8 +130,30 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
129130
return cir::PointerType::get(ty);
130131
}
131132

132-
cir::PointerType getVoidPtrTy() {
133-
return getPointerTo(cir::VoidType::get(getContext()));
133+
cir::PointerType getPointerTo(mlir::Type ty, cir::TargetAddressSpaceAttr as) {
134+
return cir::PointerType::get(ty, as);
135+
}
136+
137+
cir::PointerType getPointerTo(mlir::Type ty, clang::LangAS langAS) {
138+
if (langAS == clang::LangAS::Default) // Default address space.
139+
return getPointerTo(ty);
140+
141+
if (clang::isTargetAddressSpace(langAS)) {
142+
unsigned addrSpace = clang::toTargetAddressSpace(langAS);
143+
auto asAttr = cir::TargetAddressSpaceAttr::get(
144+
getContext(), getUI32IntegerAttr(addrSpace));
145+
return getPointerTo(ty, asAttr);
146+
}
147+
148+
llvm_unreachable("language-specific address spaces NYI");
149+
}
150+
151+
cir::PointerType getVoidPtrTy(clang::LangAS langAS = clang::LangAS::Default) {
152+
return getPointerTo(cir::VoidType::get(getContext()), langAS);
153+
}
154+
155+
cir::PointerType getVoidPtrTy(cir::TargetAddressSpaceAttr as) {
156+
return getPointerTo(cir::VoidType::get(getContext()), as);
134157
}
135158

136159
cir::BoolAttr getCIRBoolAttr(bool state) {
@@ -155,9 +178,10 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
155178
}
156179

157180
mlir::Value createComplexImag(mlir::Location loc, mlir::Value operand) {
158-
auto operandTy = mlir::cast<cir::ComplexType>(operand.getType());
159-
return cir::ComplexImagOp::create(*this, loc, operandTy.getElementType(),
160-
operand);
181+
auto resultType = operand.getType();
182+
if (auto complexResultType = mlir::dyn_cast<cir::ComplexType>(resultType))
183+
resultType = complexResultType.getElementType();
184+
return cir::ComplexImagOp::create(*this, loc, resultType, operand);
161185
}
162186

163187
cir::LoadOp createLoad(mlir::Location loc, mlir::Value ptr,

0 commit comments

Comments
 (0)