Skip to content

Commit fda6d3f

Browse files
Merge branch 'llvm:main' into cfi-show
2 parents 8c967c8 + a34b110 commit fda6d3f

File tree

539 files changed

+53763
-13714
lines changed

Some content is hidden

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

539 files changed

+53763
-13714
lines changed

bolt/runtime/instr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,11 @@ static char *getBinaryPath() {
714714
uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
715715
assert(Ret != -1 && Ret != BufSize, "readlink error");
716716
TargetPath[Ret] = '\0';
717+
__close(FDdir);
717718
return TargetPath;
718719
}
719720
}
721+
__close(FDdir);
720722
return nullptr;
721723
}
722724

clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct IntegerLiteralCheck {
2929
// integer (wb), and can be a complex number ('i', 'j'). In MS compatibility
3030
// mode, suffixes like i32 are supported.
3131
static constexpr llvm::StringLiteral Suffixes =
32-
llvm::StringLiteral("uUlLzZwWbBiIjJ");
32+
llvm::StringLiteral("uUlLzZwWiIjJ");
3333
};
3434

3535
struct FloatingLiteralCheck {

clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,12 @@ void integer_suffix() {
128128
static_assert(is_same<decltype(v24), const unsigned long long>::value, "");
129129
static_assert(v24 == 1, "");
130130
}
131+
132+
void no_warning_on_hex_literals() {
133+
int a = 0xa;
134+
int b = 0xb;
135+
int c = 0xc;
136+
int d = 0xd;
137+
int e = 0xe;
138+
int f = 0xf;
139+
}

clang/docs/OpenMPSupport.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ implementation.
443443
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
444444
| Traits for default device envirable | :none:`unclaimed` | :none:`unclaimed` | |
445445
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
446-
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/148048 |
446+
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | (Parse) https://github.com/llvm/llvm-project/pull/148048, |
447+
| | | | (Sema) https://github.com/llvm/llvm-project/pull/152786 |
447448
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
448449
| Canonical loop sequences | :none:`unclaimed` | :part:`In Progress` | |
449450
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ OpenMP Support
482482
modifier in the ``adjust_args`` clause.
483483
- Allow array length to be omitted in array section subscript expression.
484484
- Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause.
485+
- Properly handle array section/assumed-size array privatization in C/C++.
485486

486487
Improvements
487488
^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ def AnalyzerNoReturn : InheritableAttr {
979979
}
980980

981981
def InferredNoReturn : InheritableAttr {
982-
let Spellings = [];
982+
let Spellings = [];
983983
let SemaHandler = 0;
984984
let Subjects = SubjectList<[Function], ErrorDiag>;
985985
let Documentation = [InternalOnly];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,45 +3752,45 @@ functions intended for different purposes have distinct CFI identities.
37523752

37533753
// Header file - define convenience macros
37543754
#define __cfi_salt(s) __attribute__((cfi_salt(s)))
3755-
3755+
37563756
// Typedef for regular function pointers
37573757
typedef int (*fptr_t)(void);
3758-
3759-
// Typedef for salted function pointers
3758+
3759+
// Typedef for salted function pointers
37603760
typedef int (*fptr_salted_t)(void) __cfi_salt("pepper");
3761-
3761+
37623762
struct widget_ops {
37633763
fptr_t init; // Regular CFI
37643764
fptr_salted_t exec; // Salted CFI
37653765
fptr_t cleanup; // Regular CFI
37663766
};
3767-
3767+
37683768
// Function implementations
37693769
static int widget_init(void) { return 0; }
37703770
static int widget_exec(void) __cfi_salt("pepper") { return 1; }
37713771
static int widget_cleanup(void) { return 0; }
3772-
3772+
37733773
static struct widget_ops ops = {
37743774
.init = widget_init, // OK - compatible types
37753775
.exec = widget_exec, // OK - both use "pepper" salt
37763776
.cleanup = widget_cleanup // OK - compatible types
37773777
};
3778-
3778+
37793779
// Using C++11 attribute syntax
37803780
void secure_callback(void) [[clang::cfi_salt("secure")]];
3781-
3781+
37823782
// This would cause a compilation error:
37833783
// fptr_t bad_ptr = widget_exec; // Error: incompatible types
37843784

37853785
**Notes:**
37863786

37873787
* The salt string can contain non-NULL ASCII characters, including spaces and
37883788
quotes
3789-
* This attribute only applies to function types; using it on non-function
3789+
* This attribute only applies to function types; using it on non-function
37903790
types will generate a warning
3791-
* All declarations and definitions of the same function must use identical
3791+
* All declarations and definitions of the same function must use identical
37923792
salt values
3793-
* The attribute affects type compatibility during compilation and CFI hash
3793+
* The attribute affects type compatibility during compilation and CFI hash
37943794
generation during code generation
37953795
}];
37963796
}

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,10 @@ TARGET_BUILTIN(__builtin_amdgcn_flat_load_monitor_b128, "V4iV4i*0Ii", "nc", "gfx
670670
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_b32, "ii*1Iii", "nc", "gfx1250-insts,wavefrontsize32")
671671
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_b64, "V2iV2i*1Iii", "nc", "gfx1250-insts,wavefrontsize32")
672672
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_b128, "V4iV4i*1Iii", "nc", "gfx1250-insts,wavefrontsize32")
673+
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_async_to_lds_b8, "vc*1c*3IiIii", "nc", "gfx1250-insts,wavefrontsize32")
674+
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_async_to_lds_b32, "vi*1i*3IiIii", "nc", "gfx1250-insts,wavefrontsize32")
675+
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_async_to_lds_b64, "vV2i*1V2i*3IiIii", "nc", "gfx1250-insts,wavefrontsize32")
676+
TARGET_BUILTIN(__builtin_amdgcn_cluster_load_async_to_lds_b128, "vV4i*1V4i*3IiIii", "nc", "gfx1250-insts,wavefrontsize32")
673677
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b8, "vc*1c*3IiIi", "nc", "gfx1250-insts")
674678
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b32, "vi*1i*3IiIi", "nc", "gfx1250-insts")
675679
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b64, "vV2i*1V2i*3IiIi", "nc", "gfx1250-insts")

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,7 @@ def note_unsatisfied_trait
17731773
"%TriviallyCopyable{trivially copyable}|"
17741774
"%Empty{empty}|"
17751775
"%StandardLayout{standard-layout}|"
1776+
"%Aggregate{aggregate}|"
17761777
"%Final{final}"
17771778
"}1">;
17781779

@@ -1794,6 +1795,7 @@ def note_unsatisfied_trait_reason
17941795
"%NTCBase{has a non-trivially-copyable base %1}|"
17951796
"%NTCField{has a non-trivially-copyable member %1 of type %2}|"
17961797
"%NonEmptyMember{has a non-static data member %1 of type %2}|"
1798+
"%PolymorphicType{is a polymorphic type}|"
17971799
"%VirtualFunction{has a virtual function %1}|"
17981800
"%NonEmptyBase{has a base class %1 that is not empty}|"
17991801
"%NonZeroLengthField{field %1 is a non-zero-length bit-field}|"
@@ -1806,6 +1808,8 @@ def note_unsatisfied_trait_reason
18061808
"%DeletedDtr{has a %select{deleted|user-provided}1 destructor}|"
18071809
"%UserProvidedCtr{has a user provided %select{copy|move}1 "
18081810
"constructor}|"
1811+
"%UserDeclaredCtr{has a user-declared constructor}|"
1812+
"%InheritedCtr{has an inherited constructor}|"
18091813
"%DeletedCtr{has a deleted %select{copy|move}1 "
18101814
"constructor}|"
18111815
"%UserProvidedAssign{has a user provided %select{copy|move}1 "
@@ -1817,6 +1821,8 @@ def note_unsatisfied_trait_reason
18171821
"%FunctionType{is a function type}|"
18181822
"%CVVoidType{is a cv void type}|"
18191823
"%IncompleteArrayType{is an incomplete array type}|"
1824+
"%PrivateProtectedDirectDataMember{has a %select{private|protected}1 direct data member}|"
1825+
"%PrivateProtectedDirectBase{has a %select{private|protected}1 direct base}|"
18201826
"%NotClassOrUnion{is not a class or union type}|"
18211827
"%NotMarkedFinal{is not marked 'final'}"
18221828
"}0">;
@@ -10692,7 +10698,7 @@ def warn_dangling_reference_captured_by_unknown : Warning<
1069210698

1069310699
// Diagnostics based on the Lifetime safety analysis.
1069410700
def warn_lifetime_safety_loan_expires_permissive : Warning<
10695-
"object whose reference is captured does not live long enough">,
10701+
"object whose reference is captured does not live long enough">,
1069610702
InGroup<LifetimeSafetyPermissive>, DefaultIgnore;
1069710703
def warn_lifetime_safety_loan_expires_strict : Warning<
1069810704
"object whose reference is captured may not live long enough">,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
245245
return createGetGlobal(global.getLoc(), global);
246246
}
247247

248+
/// Create a copy with inferred length.
249+
cir::CopyOp createCopy(mlir::Value dst, mlir::Value src) {
250+
return cir::CopyOp::create(*this, dst.getLoc(), dst, src);
251+
}
252+
248253
cir::StoreOp createStore(mlir::Location loc, mlir::Value val, mlir::Value dst,
249254
bool isVolatile = false,
250255
mlir::IntegerAttr align = {},

0 commit comments

Comments
 (0)