Skip to content

Commit 4cde3bd

Browse files
Merge branch 'llvm:main' into flang-x86-check-cpu
2 parents eb6f592 + 2130285 commit 4cde3bd

File tree

463 files changed

+12807
-3936
lines changed

Some content is hidden

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

463 files changed

+12807
-3936
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
fetch-depth: 1
6666
- name: Get subprojects that have doc changes
6767
id: docs-changed-subprojects
68-
uses: tj-actions/changed-files@fea790cb660e33aef4bdf07304e28fedd77dfa13 # v39.2.4
68+
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 # v45.0.7
6969
with:
7070
files_yaml: |
7171
llvm:

.github/workflows/issue-write.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: 'Comment on PR'
4141
if: steps.download-artifact.outputs.artifact-id != ''
42-
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
42+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4343
with:
4444
github-token: ${{ secrets.GITHUB_TOKEN }}
4545
script: |

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ Bug Fixes in This Version
248248
(#GH125500).
249249
- Fixed clang crash when #embed data does not fit into an array
250250
(#GH128987).
251+
- Non-local variable and non-variable declarations in the first clause of a ``for`` loop in C are no longer incorrectly
252+
considered an error in C23 mode and are allowed as an extension in earlier language modes.
251253

252254
Bug Fixes to Compiler Builtins
253255
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -361,6 +363,8 @@ Fixed Point Support in Clang
361363
AST Matchers
362364
------------
363365

366+
- Ensure ``isDerivedFrom`` matches the correct base in case more than one alias exists.
367+
364368
clang-format
365369
------------
366370

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26612661
bool isHLSLSpecificType() const; // Any HLSL specific type
26622662
bool isHLSLBuiltinIntangibleType() const; // Any HLSL builtin intangible type
26632663
bool isHLSLAttributedResourceType() const;
2664+
bool isHLSLResourceRecord() const;
26642665
bool isHLSLIntangibleType()
26652666
const; // Any HLSL intangible type (builtin, array, class)
26662667

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,6 +4765,12 @@ def GetDeviceSideMangledName : LangBuiltin<"CUDA_LANG"> {
47654765
}
47664766

47674767
// HLSL
4768+
def HLSLAddUint64: LangBuiltin<"HLSL_LANG"> {
4769+
let Spellings = ["__builtin_hlsl_adduint64"];
4770+
let Attributes = [NoThrow, Const];
4771+
let Prototype = "void(...)";
4772+
}
4773+
47684774
def HLSLResourceGetPointer : LangBuiltin<"HLSL_LANG"> {
47694775
let Spellings = ["__builtin_hlsl_resource_getpointer"];
47704776
let Attributes = [NoThrow];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10709,6 +10709,11 @@ def err_vector_incorrect_num_elements : Error<
1070910709
"%select{too many|too few}0 elements in vector %select{initialization|operand}3 (expected %1 elements, have %2)">;
1071010710
def err_altivec_empty_initializer : Error<"expected initializer">;
1071110711

10712+
def err_vector_incorrect_bit_count : Error<
10713+
"incorrect number of bits in vector operand (expected %select{|a multiple of}0 %1 bits, have %2)">;
10714+
def err_integer_incorrect_bit_count : Error<
10715+
"incorrect number of bits in integer (expected %0 bits, have %1)">;
10716+
1071210717
def err_invalid_neon_type_code : Error<
1071310718
"incompatible constant for this __builtin_neon function">;
1071410719
def err_argument_invalid_range : Error<
@@ -10797,6 +10802,23 @@ def err_non_local_variable_decl_in_for : Error<
1079710802
"declaration of non-local variable in 'for' loop">;
1079810803
def err_non_variable_decl_in_for : Error<
1079910804
"non-variable declaration in 'for' loop">;
10805+
10806+
def ext_c23_non_local_variable_decl_in_for : Extension<
10807+
"declaration of non-local variable in 'for' loop is a C23 extension">,
10808+
InGroup<C23>;
10809+
10810+
def warn_c17_non_local_variable_decl_in_for : Warning<
10811+
"declaration of non-local variable in 'for' loop is incompatible with C standards before C23">,
10812+
DefaultIgnore, InGroup<CPre23Compat>;
10813+
10814+
def ext_c23_non_variable_decl_in_for : Extension<
10815+
"non-variable declaration in 'for' loop is a C23 extension">,
10816+
InGroup<C23>;
10817+
10818+
def warn_c17_non_variable_decl_in_for : Warning<
10819+
"non-variable declaration in 'for' loop is incompatible with C standards before C23">,
10820+
DefaultIgnore, InGroup<CPre23Compat>;
10821+
1080010822
def err_toomany_element_decls : Error<
1080110823
"only one element declaration is allowed">;
1080210824
def err_selector_element_not_lvalue : Error<

clang/include/clang/Basic/TargetInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class TargetInfo : public TransferrableTargetInfo,
253253
const char *MCountName;
254254
unsigned char RegParmMax, SSERegParmMax;
255255
TargetCXXABI TheCXXABI;
256+
bool UseMicrosoftManglingForC = false;
256257
const LangASMap *AddrSpaceMap;
257258

258259
mutable StringRef PlatformName;
@@ -1344,6 +1345,11 @@ class TargetInfo : public TransferrableTargetInfo,
13441345
return TheCXXABI;
13451346
}
13461347

1348+
/// Should the Microsoft mangling scheme be used for C Calling Convention.
1349+
bool shouldUseMicrosoftCCforMangling() const {
1350+
return UseMicrosoftManglingForC;
1351+
}
1352+
13471353
/// Target the specified CPU.
13481354
///
13491355
/// \return False on error (invalid CPU name).

clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ enum class ScanningOptimizations {
6767
IgnoreCWD = (1 << 4),
6868

6969
DSS_LAST_BITMASK_ENUM(IgnoreCWD),
70-
Default = All
70+
71+
// The build system needs to be aware that the current working
72+
// directory is ignored. Without a good way of notifying the build
73+
// system, it is less risky to default to off.
74+
Default = All & (~IgnoreCWD)
7175
};
7276

7377
#undef DSS_LAST_BITMASK_ENUM

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
714714
return false;
715715
}
716716

717+
if (S.checkingPotentialConstantExpression() && S.Current->getDepth() != 0)
718+
return false;
719+
717720
if (F->isConstexpr() && F->hasBody() &&
718721
(F->getDecl()->isConstexpr() || F->getDecl()->hasAttr<MSConstexprAttr>()))
719722
return true;

clang/lib/AST/Mangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static CCMangling getCallingConvMangling(const ASTContext &Context,
7474
if (FD->isMain() && FD->getNumParams() == 2)
7575
return CCM_WasmMainArgcArgv;
7676

77-
if (!Triple.isOSWindows() || !Triple.isX86())
77+
if (!TI.shouldUseMicrosoftCCforMangling())
7878
return CCM_Other;
7979

8080
if (Context.getLangOpts().CPlusPlus && !isExternC(ND) &&

0 commit comments

Comments
 (0)