Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fc1f3f3
Revert "[libcxx] Define `_LIBCPP_HAS_C8RTOMB_MBRTOC8` to true if comp…
philnik777 Oct 27, 2025
07372fc
[MLIR][XeGPU] Remove leading unit dims from vector ops before unrolli…
nbpatel Oct 27, 2025
c431ee7
[MLIR][XeGPU] Fix isEvenlyDistributable API in xegpu (#164907)
nbpatel Oct 27, 2025
430d0ed
[FlowSensitive] [StatusOr] [8/N] Support value ctor and assignment
fmayer Oct 27, 2025
4ed494e
[FlowSensitive] [StatusOr] [9/N] Make sure all StatusOr are initialized
fmayer Oct 27, 2025
9a0aa92
[LLDB] Disable rosetta test on green dragon
adrian-prantl Oct 27, 2025
128214f
[llvm-remarkutil] Introduce summary tool (#160549)
tobias-stadler Oct 27, 2025
585b6e2
[flang][OpenMP] Allocate `allocatable` init temps on the stack for GP…
ergawy Oct 27, 2025
defe934
[InstrProf][NFC] Use -profile-correlate flag in tests (#163299)
ellishg Oct 27, 2025
242c716
Fix Linux kernel build failure for SytemZ. (#165274)
anoopkg6 Oct 27, 2025
e903494
[lldb] Fix TestVTableValue.py test_overwrite_vtable test (#164910)
dsandersllvm Oct 27, 2025
a868e7e
Revert "[LLDB] Disable rosetta test on green dragon"
adrian-prantl Oct 27, 2025
43f119b
[LLDB] Disable rosetta test on green dragon
adrian-prantl Oct 27, 2025
8f1c72d
[lit] Support more ulimit options
boomanaiden154 Oct 27, 2025
bce7f7c
[AMDGPU] Precommit test for sinking vector ops PR 162580 (#165050)
doru1004 Oct 27, 2025
30c3a91
[PowerPC] Add Implementation and test for new eTCE instructions (#164…
lei137 Oct 27, 2025
30f2bf7
[AMDGPU] Use implicit operand to preserve liveness of COPY (#164911)
jrbyrnes Oct 27, 2025
c1f6528
[llvm][clang] Explicitly pass the VFS to sanitizer passes (#165267)
jansvoboda11 Oct 27, 2025
263377a
[flang][Driver] Warn on -fbuiltin and -fno-builtin
tarunprabhu Oct 27, 2025
88558d5
Avoid stalls when MainLoop::Interrupt fails to wake up the MainLoop (…
jimingham Oct 27, 2025
f8a0599
[clang-format] Align comments following continued aligned lines (#164…
sstwcw Oct 27, 2025
a6788b5
[mlir][tensor] Fix runtime verification for `tensor.extract_slice` wh…
Oct 27, 2025
cbe7c49
[mlir][memref] Fix runtime verification for memref.subview when size …
Oct 27, 2025
d818434
[LLDB] Add debug output to test to diagnose bot failure
adrian-prantl Oct 27, 2025
cc868f6
[clang][DebugInfo][test] Convert Objective-C property test to check L…
Michael137 Oct 27, 2025
90489ad
[clang][DebugInfo] Disable objective-CXX tests on AIX and z/OS (#164765)
madanial0 Oct 27, 2025
616f3b5
[DA] Fix crash when two loops have different type sizes of becount (…
scui-ibm Oct 27, 2025
267b5b8
[clang][DebugInfo][test] Rename Objective-C test
Michael137 Oct 27, 2025
cd9d487
[MLIR][ExecutionEngine] don't dump decls (#164478)
makslevental Oct 27, 2025
9abae17
[UpdateTestChecks][llc] Support `arm64-apple-darwin` (#165092)
tomershafir Oct 27, 2025
dce8252
[RadixTree] Use std::optional for Node::Value (#165299)
vitalybuka Oct 27, 2025
7a24a63
merge main into amd-staging
ronlieb Oct 27, 2025
b7ba98c
Regen llvm/test/CodeGen/AMDGPU/spill-restore-partial-copy.mir
ronlieb Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning<
def warn_drv_unsupported_option_for_target : Warning<
"ignoring '%0' option as it is not currently supported for target '%1'">,
InGroup<OptionIgnored>;
def warn_drv_invalid_argument_for_flang : Warning<
"'%0' is not valid for Fortran">,
InGroup<OptionIgnored>;
def warn_drv_unsupported_option_for_flang : Warning<
"the argument '%0' is not supported for option '%1'. Mapping to '%1%2'">,
InGroup<OptionIgnored>;
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ defm borland_extensions : BoolFOption<"borland-extensions",
"Accept non-standard constructs supported by the Borland compiler">,
NegFlag<SetFalse>>;
def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>,
Visibility<[ClangOption, CLOption, DXCOption]>;
Visibility<[ClangOption, CLOption, DXCOption, FlangOption, FC1Option]>;
def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
Flags<[]>, HelpText<"Load the clang builtins module map file.">;
defm caret_diagnostics : BoolFOption<"caret-diagnostics",
Expand Down Expand Up @@ -3572,7 +3572,7 @@ def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">,
Visibility<[ClangOption, CC1Option]>,
MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>,
Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption, FC1Option]>,
HelpText<"Disable implicit builtin knowledge of functions">;
def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>,
Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,41 @@ static auto isPointerComparisonOperatorCall(std::string operator_name) {
pointee(anyOf(statusOrType(), statusType())))))));
}

// The nullPointerConstant in the two matchers below is to support
// absl::StatusOr<void*> X = nullptr.
// nullptr does not match the bound type.
// TODO: be less restrictive around convertible types in general.
static auto isStatusOrValueAssignmentCall() {
using namespace ::clang::ast_matchers; // NOLINT: Too many names
return cxxOperatorCallExpr(
hasOverloadedOperatorName("="),
callee(cxxMethodDecl(ofClass(statusOrClass()))),
hasArgument(1, anyOf(hasType(hasUnqualifiedDesugaredType(
type(equalsBoundNode("T")))),
nullPointerConstant())));
}

static auto isStatusOrValueConstructor() {
using namespace ::clang::ast_matchers; // NOLINT: Too many names
return cxxConstructExpr(
hasType(statusOrType()),
hasArgument(0,
anyOf(hasType(hasCanonicalType(type(equalsBoundNode("T")))),
nullPointerConstant(),
hasType(namedDecl(hasAnyName("absl::in_place_t",
"std::in_place_t"))))));
}

static auto isStatusOrConstructor() {
using namespace ::clang::ast_matchers; // NOLINT: Too many names
return cxxConstructExpr(hasType(statusOrType()));
}

static auto isStatusConstructor() {
using namespace ::clang::ast_matchers; // NOLINT: Too many names
return cxxConstructExpr(hasType(statusType()));
}

static auto
buildDiagnoseMatchSwitch(const UncheckedStatusOrAccessModelOptions &Options) {
return CFGMatchSwitchBuilder<const Environment,
Expand Down Expand Up @@ -528,6 +563,46 @@ static void transferEmplaceCall(const CXXMemberCallExpr *Expr,
State.Env.assume(OkVal.formula());
}

static void transferValueAssignmentCall(const CXXOperatorCallExpr *Expr,
const MatchFinder::MatchResult &,
LatticeTransferState &State) {
assert(Expr->getNumArgs() > 1);

auto *StatusOrLoc = State.Env.get<RecordStorageLocation>(*Expr->getArg(0));
if (StatusOrLoc == nullptr)
return;

auto &OkVal = initializeStatusOr(*StatusOrLoc, State.Env);
State.Env.assume(OkVal.formula());
}

static void transferValueConstructor(const CXXConstructExpr *Expr,
const MatchFinder::MatchResult &,
LatticeTransferState &State) {
auto &OkVal =
initializeStatusOr(State.Env.getResultObjectLocation(*Expr), State.Env);
State.Env.assume(OkVal.formula());
}

static void transferStatusOrConstructor(const CXXConstructExpr *Expr,
const MatchFinder::MatchResult &,
LatticeTransferState &State) {
RecordStorageLocation &StatusOrLoc = State.Env.getResultObjectLocation(*Expr);
RecordStorageLocation &StatusLoc = locForStatus(StatusOrLoc);

if (State.Env.getValue(locForOk(StatusLoc)) == nullptr)
initializeStatusOr(StatusOrLoc, State.Env);
}

static void transferStatusConstructor(const CXXConstructExpr *Expr,
const MatchFinder::MatchResult &,
LatticeTransferState &State) {
RecordStorageLocation &StatusLoc = State.Env.getResultObjectLocation(*Expr);

if (State.Env.getValue(locForOk(StatusLoc)) == nullptr)
initializeStatus(StatusLoc, State.Env);
}

CFGMatchSwitch<LatticeTransferState>
buildTransferMatchSwitch(ASTContext &Ctx,
CFGMatchSwitchBuilder<LatticeTransferState> Builder) {
Expand Down Expand Up @@ -573,6 +648,20 @@ buildTransferMatchSwitch(ASTContext &Ctx,
.CaseOfCFGStmt<CallExpr>(isNotOkStatusCall(), transferNotOkStatusCall)
.CaseOfCFGStmt<CXXMemberCallExpr>(isStatusOrMemberCallWithName("emplace"),
transferEmplaceCall)
.CaseOfCFGStmt<CXXOperatorCallExpr>(isStatusOrValueAssignmentCall(),
transferValueAssignmentCall)
.CaseOfCFGStmt<CXXConstructExpr>(isStatusOrValueConstructor(),
transferValueConstructor)
// N.B. These need to come after all other CXXConstructExpr.
// These are there to make sure that every Status and StatusOr object
// have their ok boolean initialized when constructed. If we were to
// lazily initialize them when we first access them, we can produce
// false positives if that first access is in a control flow statement.
// You can comment out these two constructors and see tests fail.
.CaseOfCFGStmt<CXXConstructExpr>(isStatusOrConstructor(),
transferStatusOrConstructor)
.CaseOfCFGStmt<CXXConstructExpr>(isStatusConstructor(),
transferStatusConstructor)
.Build();
}

Expand Down
8 changes: 5 additions & 3 deletions clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,16 @@ static void addSanitizers(const Triple &TargetTriple,
ThinOrFullLTOPhase) {
if (CodeGenOpts.hasSanitizeCoverage()) {
auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts);
MPM.addPass(SanitizerCoveragePass(
SancovOpts, CodeGenOpts.SanitizeCoverageAllowlistFiles,
CodeGenOpts.SanitizeCoverageIgnorelistFiles));
MPM.addPass(
SanitizerCoveragePass(SancovOpts, PB.getVirtualFileSystemPtr(),
CodeGenOpts.SanitizeCoverageAllowlistFiles,
CodeGenOpts.SanitizeCoverageIgnorelistFiles));
}

if (CodeGenOpts.hasSanitizeBinaryMetadata()) {
MPM.addPass(SanitizerBinaryMetadataPass(
getSanitizerBinaryMetadataOptions(CodeGenOpts),
PB.getVirtualFileSystemPtr(),
CodeGenOpts.SanitizeMetadataIgnorelistFiles));
}

Expand Down
7 changes: 7 additions & 0 deletions clang/lib/Driver/ToolChains/Flang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,13 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
assert(false && "Unexpected action class for Flang tool.");
}

// We support some options that are invalid for Fortran and have no effect.
// These are solely for compatibility with other compilers. Emit a warning if
// any such options are provided, then proceed normally.
for (options::ID Opt : {options::OPT_fbuiltin, options::OPT_fno_builtin})
if (const Arg *A = Args.getLastArg(Opt))
D.Diag(diag::warn_drv_invalid_argument_for_flang) << A->getSpelling();

const InputInfo &Input = Inputs[0];
types::ID InputType = Input.getType();

Expand Down
25 changes: 17 additions & 8 deletions clang/lib/Format/WhitespaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
ArrayRef<unsigned> Matches,
SmallVector<WhitespaceManager::Change, 16> &Changes) {
int Shift = 0;
// Set when the shift is applied anywhere in the line. Cleared when the line
// ends.
bool LineShifted = false;

// ScopeStack keeps track of the current scope depth. It contains the levels
// of at most 2 scopes. The first one is the one that the matched token is
Expand Down Expand Up @@ -339,8 +342,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
Changes[i - 1].Tok->is(tok::string_literal);
bool SkipMatchCheck = InsideNestedScope || ContinuedStringLiteral;

if (CurrentChange.NewlinesBefore > 0 && !SkipMatchCheck)
Shift = 0;
if (CurrentChange.NewlinesBefore > 0) {
LineShifted = false;
if (!SkipMatchCheck)
Shift = 0;
}

// If this is the first matching token to be aligned, remember by how many
// spaces it has to be shifted, so the rest of the changes on the line are
Expand All @@ -349,7 +355,6 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
Shift = Column - (RightJustify ? CurrentChange.TokenLength : 0) -
CurrentChange.StartOfTokenColumn;
ScopeStack = {CurrentChange.indentAndNestingLevel()};
CurrentChange.Spaces += Shift;
}

if (Shift == 0)
Expand All @@ -358,8 +363,10 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
// This is for lines that are split across multiple lines, as mentioned in
// the ScopeStack comment. The stack size being 1 means that the token is
// not in a scope that should not move.
if (ScopeStack.size() == 1u && CurrentChange.NewlinesBefore > 0 &&
(ContinuedStringLiteral || InsideNestedScope)) {
if ((!Matches.empty() && Matches[0] == i) ||
(ScopeStack.size() == 1u && CurrentChange.NewlinesBefore > 0 &&
(ContinuedStringLiteral || InsideNestedScope))) {
LineShifted = true;
CurrentChange.Spaces += Shift;
}

Expand All @@ -369,9 +376,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
static_cast<int>(Changes[i].Tok->SpacesRequiredBefore) ||
CurrentChange.Tok->is(tok::eof));

CurrentChange.StartOfTokenColumn += Shift;
if (i + 1 != Changes.size())
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
if (LineShifted) {
CurrentChange.StartOfTokenColumn += Shift;
if (i + 1 != Changes.size())
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
}

// If PointerAlignment is PAS_Right, keep *s or &s next to the token,
// except if the token is equal, then a space is needed.
Expand Down
20 changes: 20 additions & 0 deletions clang/test/DebugInfo/ObjC/property-basic.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Checks basic debug-info generation for property. Makes sure we
// create a DIObjCProperty for the synthesized property.

// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s

// CHECK: !DIObjCProperty(name: "p1"
// CHECK-SAME: attributes: 2316
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
//
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"

@interface I1 {
int p1;
}
@property int p1;
@end

@implementation I1
@synthesize p1;
@end
15 changes: 0 additions & 15 deletions clang/test/DebugInfo/ObjC/property.m

This file was deleted.

5 changes: 5 additions & 0 deletions clang/test/DebugInfo/ObjCXX/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# objective-CXX is not supported on AIX and zOS
unsupported_platforms = [ "system-aix", "system-zos" ]

if any(up in config.available_features for up in unsupported_platforms):
config.unsupported = True
Loading