Skip to content

Commit e3a122f

Browse files
authored
Merge branch 'main' into lldb/highlight-no-debuginfo
2 parents db417e8 + d605a0d commit e3a122f

File tree

206 files changed

+3658
-3555
lines changed

Some content is hidden

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

206 files changed

+3658
-3555
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ jobs:
7373
START_REV: ${{ github.event.pull_request.base.sha }}
7474
END_REV: ${{ github.event.pull_request.head.sha }}
7575
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
76-
# TODO(boomanaiden154): Once clang v18 is released, we should be able
77-
# to take advantage of the new --diff_from_common_commit option
78-
# explicitly in code-format-helper.py and not have to diff starting at
79-
# the merge base.
8076
# Create an empty comments file so the pr-write job doesn't fail.
8177
run: |
8278
echo "[]" > comments &&

.github/workflows/premerge.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
export CXX=/opt/llvm/bin/clang++
6666
6767
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}"
68-
- name: "Upload artifact"
6968
- name: Upload Artifacts
7069
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
7170
with:

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,8 @@ RISC-V Support
646646
Qualcomm's `Xqciint` extension to save and restore some GPRs in interrupt
647647
service routines.
648648

649+
- `Zicsr` / `Zifencei` are allowed to be duplicated in the presence of `g` in `-march`.
650+
649651
CUDA/HIP Language Changes
650652
^^^^^^^^^^^^^^^^^^^^^^^^^
651653

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
9090
return cir::FPAttr::getZero(ty);
9191
if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
9292
return cir::ZeroAttr::get(arrTy);
93+
if (auto vecTy = mlir::dyn_cast<cir::VectorType>(ty))
94+
return cir::ZeroAttr::get(vecTy);
9395
if (auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
9496
return getConstNullPtrAttr(ptrTy);
9597
if (auto recordTy = mlir::dyn_cast<cir::RecordType>(ty))

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,43 @@ def CIR_ArrayType : CIR_Type<"Array", "array",
307307
}];
308308
}
309309

310+
//===----------------------------------------------------------------------===//
311+
// VectorType (fixed size)
312+
//===----------------------------------------------------------------------===//
313+
314+
def CIR_VectorType : CIR_Type<"Vector", "vector",
315+
[DeclareTypeInterfaceMethods<DataLayoutTypeInterface>]> {
316+
317+
let summary = "CIR vector type";
318+
let description = [{
319+
`!cir.vector' represents fixed-size vector types, parameterized
320+
by the element type and the number of elements.
321+
322+
Example:
323+
324+
```mlir
325+
!cir.vector<!u64i x 2>
326+
!cir.vector<!cir.float x 4>
327+
```
328+
}];
329+
330+
let parameters = (ins "mlir::Type":$elementType, "uint64_t":$size);
331+
332+
let assemblyFormat = [{
333+
`<` $size `x` $elementType `>`
334+
}];
335+
336+
let builders = [
337+
TypeBuilderWithInferredContext<(ins
338+
"mlir::Type":$elementType, "uint64_t":$size
339+
), [{
340+
return $_get(elementType.getContext(), elementType, size);
341+
}]>,
342+
];
343+
344+
let genVerifyDecl = 1;
345+
}
346+
310347
//===----------------------------------------------------------------------===//
311348
// FuncType
312349
//===----------------------------------------------------------------------===//
@@ -533,8 +570,8 @@ def CIRRecordType : Type<
533570
//===----------------------------------------------------------------------===//
534571

535572
def CIR_AnyType : AnyTypeOf<[
536-
CIR_VoidType, CIR_BoolType, CIR_ArrayType, CIR_IntType, CIR_AnyFloat,
537-
CIR_PointerType, CIR_FuncType, CIR_RecordType
573+
CIR_VoidType, CIR_BoolType, CIR_ArrayType, CIR_VectorType, CIR_IntType,
574+
CIR_AnyFloat, CIR_PointerType, CIR_FuncType, CIR_RecordType
538575
]>;
539576

540577
#endif // MLIR_CIR_DIALECT_CIR_TYPES

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,13 @@ static bool interp__builtin_operator_delete(InterpState &S, CodePtr OpPC,
16411641

16421642
Source = Ptr.getDeclDesc()->asExpr();
16431643
BlockToDelete = Ptr.block();
1644+
1645+
if (!BlockToDelete->isDynamic()) {
1646+
S.FFDiag(Call, diag::note_constexpr_delete_not_heap_alloc)
1647+
<< Ptr.toDiagnosticString(S.getASTContext());
1648+
if (const auto *D = Ptr.getFieldDesc()->asDecl())
1649+
S.Note(D->getLocation(), diag::note_declared_at);
1650+
}
16441651
}
16451652
assert(BlockToDelete);
16461653

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,21 @@ void MicrosoftCXXNameMangler::mangleType(const DependentSizedExtVectorType *T,
35353535

35363536
void MicrosoftCXXNameMangler::mangleType(const ConstantMatrixType *T,
35373537
Qualifiers quals, SourceRange Range) {
3538-
Error(Range.getBegin(), "matrix type") << Range;
3538+
QualType EltTy = T->getElementType();
3539+
3540+
llvm::SmallString<64> TemplateMangling;
3541+
llvm::raw_svector_ostream Stream(TemplateMangling);
3542+
MicrosoftCXXNameMangler Extra(Context, Stream);
3543+
3544+
Stream << "?$";
3545+
3546+
Extra.mangleSourceName("__matrix");
3547+
Extra.mangleType(EltTy, Range, QMM_Escape);
3548+
3549+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumRows()));
3550+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumColumns()));
3551+
3552+
mangleArtificialTagType(TagTypeKind::Struct, TemplateMangling, {"__clang"});
35393553
}
35403554

35413555
void MicrosoftCXXNameMangler::mangleType(const DependentSizedMatrixType *T,

clang/lib/Basic/Targets/OSTargets.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -618,14 +618,7 @@ class LLVM_LIBRARY_VISIBILITY SolarisTargetInfo : public OSTargetInfo<Target> {
618618
DefineStd(Builder, "unix", Opts);
619619
Builder.defineMacro("__svr4__");
620620
Builder.defineMacro("__SVR4");
621-
// Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and
622-
// newer, but to 500 for everything else. feature_test.h has a check to
623-
// ensure that you are not using C99 with an old version of X/Open or C89
624-
// with a new version.
625-
if (Opts.C99)
626-
Builder.defineMacro("_XOPEN_SOURCE", "600");
627-
else
628-
Builder.defineMacro("_XOPEN_SOURCE", "500");
621+
Builder.defineMacro("_XOPEN_SOURCE", "600");
629622
if (Opts.CPlusPlus) {
630623
Builder.defineMacro("__C99FEATURES__");
631624
Builder.defineMacro("_FILE_OFFSET_BITS", "64");

clang/lib/CIR/CodeGen/CIRGenBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
8383
cir::IntType>(ty))
8484
return true;
8585

86+
if (const auto vt = mlir::dyn_cast<cir::VectorType>(ty))
87+
return isSized(vt.getElementType());
88+
8689
assert(!cir::MissingFeatures::unsizedTypes());
8790
return false;
8891
}

clang/lib/CIR/CodeGen/CIRGenTypes.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,14 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
399399
break;
400400
}
401401

402+
case Type::ExtVector:
403+
case Type::Vector: {
404+
const VectorType *vec = cast<VectorType>(ty);
405+
const mlir::Type elemTy = convertType(vec->getElementType());
406+
resultType = cir::VectorType::get(elemTy, vec->getNumElements());
407+
break;
408+
}
409+
402410
case Type::FunctionNoProto:
403411
case Type::FunctionProto:
404412
resultType = convertFunctionTypeInternal(type);

0 commit comments

Comments
 (0)