Skip to content

Commit 9c4df8e

Browse files
authored
merge main into amd-staging (llvm#727)
2 parents 63a6783 + 003b547 commit 9c4df8e

File tree

95 files changed

+4884
-863
lines changed

Some content is hidden

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

95 files changed

+4884
-863
lines changed

.ci/generate_test_report_lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def generate_report(
184184
if return_code == 0:
185185
report.extend(
186186
[
187-
"The build succeeded and no tests ran. This is expected in some "
188-
"build configurations."
187+
":white_check_mark: The build succeeded and no tests ran. "
188+
"This is expected in some build configurations."
189189
]
190190
)
191191
else:
@@ -272,6 +272,10 @@ def plural(num_tests):
272272
]
273273
)
274274
report.extend(_format_failures(ninja_failures, failure_explanations))
275+
else:
276+
report.extend(
277+
["", ":white_check_mark: The build succeeded and all tests passed."]
278+
)
275279

276280
if failures or return_code != 0:
277281
report.extend(["", UNRELATED_FAILURES_STR])

.ci/generate_test_report_lib_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_title_only(self):
194194
"""\
195195
# Foo
196196
197-
The build succeeded and no tests ran. This is expected in some build configurations."""
197+
:white_check_mark: The build succeeded and no tests ran. This is expected in some build configurations."""
198198
),
199199
)
200200

@@ -308,7 +308,9 @@ def test_no_failures(self):
308308
"""\
309309
# Foo
310310
311-
* 1 test passed"""
311+
* 1 test passed
312+
313+
:white_check_mark: The build succeeded and all tests passed."""
312314
)
313315
),
314316
)

.github/workflows/test-unprivileged-download-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-24.04
3838
needs: [ upload-test-artifact ]
3939
steps:
40-
- name: Chekcout LLVM
40+
- name: Checkout LLVM
4141
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4242
with:
4343
sparse-checkout: |

clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def CIR_AnyComplexType : CIR_TypeBase<"::cir::ComplexType", "complex type">;
173173

174174
def CIR_AnyComplexOrIntOrBoolOrFloatType
175175
: AnyTypeOf<[CIR_AnyComplexType, CIR_AnyIntOrBoolOrFloatType],
176-
"complex, integer or floating point type"> {
176+
"complex, integer, boolean or floating point type"> {
177177
let cppFunctionName = "isComplexOrIntegerOrBoolOrFloatingPointType";
178178
}
179179

clang/include/clang/Tooling/Transformer/RangeSelector.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ RangeSelector enclose(RangeSelector Begin, RangeSelector End);
3737
/// Convenience version of \c range where end-points are bound nodes.
3838
RangeSelector encloseNodes(std::string BeginID, std::string EndID);
3939

40+
/// Selects the merge of the two ranges, i.e. from min(First.begin,
41+
/// Second.begin) to max(First.end, Second.end).
42+
RangeSelector merge(RangeSelector First, RangeSelector Second);
43+
4044
/// DEPRECATED. Use `enclose`.
4145
inline RangeSelector range(RangeSelector Begin, RangeSelector End) {
4246
return enclose(std::move(Begin), std::move(End));

clang/lib/Analysis/Consumed.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,12 +1354,13 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) {
13541354

13551355
case CFGElement::AutomaticObjectDtor: {
13561356
const CFGAutomaticObjDtor &DTor = B.castAs<CFGAutomaticObjDtor>();
1357+
const auto *DD = DTor.getDestructorDecl(AC.getASTContext());
1358+
if (!DD)
1359+
break;
1360+
13571361
SourceLocation Loc = DTor.getTriggerStmt()->getEndLoc();
13581362
const VarDecl *Var = DTor.getVarDecl();
1359-
1360-
Visitor.checkCallability(PropagationInfo(Var),
1361-
DTor.getDestructorDecl(AC.getASTContext()),
1362-
Loc);
1363+
Visitor.checkCallability(PropagationInfo(Var), DD, Loc);
13631364
break;
13641365
}
13651366

clang/lib/CodeGen/CGCUDARuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ static llvm::Value *emitGetParamBuf(CodeGenFunction &CGF,
6262
RValue CGCUDARuntime::EmitCUDADeviceKernelCallExpr(
6363
CodeGenFunction &CGF, const CUDAKernelCallExpr *E,
6464
ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke) {
65-
ASTContext &Ctx = CGM.getContext();
66-
assert(Ctx.getcudaLaunchDeviceDecl() == E->getConfig()->getDirectCallee());
65+
assert(CGM.getContext().getcudaLaunchDeviceDecl() ==
66+
E->getConfig()->getDirectCallee());
6767

6868
llvm::BasicBlock *ConfigOKBlock = CGF.createBasicBlock("dkcall.configok");
6969
llvm::BasicBlock *ContBlock = CGF.createBasicBlock("dkcall.end");

clang/lib/Tooling/Transformer/Parsing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ getBinaryStringSelectors() {
108108
static const llvm::StringMap<RangeSelectorOp<RangeSelector, RangeSelector>> &
109109
getBinaryRangeSelectors() {
110110
static const llvm::StringMap<RangeSelectorOp<RangeSelector, RangeSelector>>
111-
M = {{"enclose", enclose}, {"between", between}};
111+
M = {{"enclose", enclose}, {"between", between}, {"merge", merge}};
112112
return M;
113113
}
114114

clang/lib/Tooling/Transformer/RangeSelector.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,63 @@ RangeSelector transformer::encloseNodes(std::string BeginID,
178178
return transformer::enclose(node(std::move(BeginID)), node(std::move(EndID)));
179179
}
180180

181+
RangeSelector transformer::merge(RangeSelector First, RangeSelector Second) {
182+
return [First,
183+
Second](const MatchResult &Result) -> Expected<CharSourceRange> {
184+
Expected<CharSourceRange> FirstRange = First(Result);
185+
if (!FirstRange)
186+
return FirstRange.takeError();
187+
Expected<CharSourceRange> SecondRange = Second(Result);
188+
if (!SecondRange)
189+
return SecondRange.takeError();
190+
191+
SourceLocation FirstB = FirstRange->getBegin();
192+
SourceLocation FirstE = FirstRange->getEnd();
193+
SourceLocation SecondB = SecondRange->getBegin();
194+
SourceLocation SecondE = SecondRange->getEnd();
195+
// Result begin loc is the minimum of the begin locs of the two ranges.
196+
SourceLocation B =
197+
Result.SourceManager->isBeforeInTranslationUnit(FirstB, SecondB)
198+
? FirstB
199+
: SecondB;
200+
if (FirstRange->isTokenRange() && SecondRange->isTokenRange()) {
201+
// Both ranges are token ranges. Just take the maximum of their end locs.
202+
SourceLocation E =
203+
Result.SourceManager->isBeforeInTranslationUnit(FirstE, SecondE)
204+
? SecondE
205+
: FirstE;
206+
return CharSourceRange::getTokenRange(B, E);
207+
}
208+
209+
if (FirstRange->isTokenRange()) {
210+
// The end of the first range is a token. Need to resolve the token to a
211+
// char range.
212+
FirstE = Lexer::getLocForEndOfToken(FirstE, /*Offset=*/0,
213+
*Result.SourceManager,
214+
Result.Context->getLangOpts());
215+
if (FirstE.isInvalid())
216+
return invalidArgumentError(
217+
"merge: can't resolve first token range to valid source range");
218+
}
219+
if (SecondRange->isTokenRange()) {
220+
// The end of the second range is a token. Need to resolve the token to a
221+
// char range.
222+
SecondE = Lexer::getLocForEndOfToken(SecondE, /*Offset=*/0,
223+
*Result.SourceManager,
224+
Result.Context->getLangOpts());
225+
if (SecondE.isInvalid())
226+
return invalidArgumentError(
227+
"merge: can't resolve second token range to valid source range");
228+
}
229+
// Result end loc is the maximum of the end locs of the two ranges.
230+
SourceLocation E =
231+
Result.SourceManager->isBeforeInTranslationUnit(FirstE, SecondE)
232+
? SecondE
233+
: FirstE;
234+
return CharSourceRange::getCharRange(B, E);
235+
};
236+
}
237+
181238
RangeSelector transformer::member(std::string ID) {
182239
return [ID](const MatchResult &Result) -> Expected<CharSourceRange> {
183240
Expected<DynTypedNode> Node = getNode(Result.Nodes, ID);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %clang_cc1 -fsyntax-only -verify -Wconsumed -fcxx-exceptions -std=c++11 %s
2+
// expected-no-diagnostics
3+
4+
struct foo {
5+
~foo();
6+
};
7+
struct bar : foo {};
8+
struct baz : bar {};
9+
baz foobar(baz a) { return a; }

0 commit comments

Comments
 (0)