Skip to content

Commit cedb28b

Browse files
authored
Merge branch 'main' into feat/attr-scope
2 parents fc838ca + 0da9aac commit cedb28b

File tree

147 files changed

+7849
-2361
lines changed

Some content is hidden

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

147 files changed

+7849
-2361
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,40 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
build_type: [Debug, Release, MinSizeRel]
18+
# Build basic linux configuration with Debug/Release/MinSizeRel and all
19+
# other configurations in Debug only.
1920
include:
2021
- os: ubuntu-24.04
22+
build_type: Debug
23+
ccache-variant: sccache
24+
c_compiler: clang-21
25+
cpp_compiler: clang++-21
26+
target: x86_64-unknown-linux-llvm
27+
include_scudo: ON
28+
- os: ubuntu-24.04
29+
build_type: Release
30+
ccache-variant: sccache
31+
c_compiler: clang-21
32+
cpp_compiler: clang++-21
33+
target: x86_64-unknown-linux-llvm
34+
include_scudo: ON
35+
- os: ubuntu-24.04
36+
build_type: MinSizeRel
2137
ccache-variant: sccache
2238
c_compiler: clang-21
2339
cpp_compiler: clang++-21
2440
target: x86_64-unknown-linux-llvm
2541
include_scudo: ON
2642
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
2743
- os: ubuntu-24.04-arm
44+
build_type: Debug
2845
ccache-variant: ccache
2946
c_compiler: clang-21
3047
cpp_compiler: clang++-21
3148
target: aarch64-unknown-linux-llvm
3249
include_scudo: ON
3350
- os: ubuntu-24.04
51+
build_type: Debug
3452
ccache-variant: ccache
3553
c_compiler: clang-21
3654
cpp_compiler: clang++-21
@@ -97,7 +115,7 @@ jobs:
97115
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
98116
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
99117
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
100-
-DLLVM_RUNTIMES_TARGET=${{ matrix.target }} \
118+
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
101119
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
102120
-DLLVM_LIBC_FULL_BUILD=ON \
103121
-G Ninja \

.github/workflows/libc-overlay-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
1717
fail-fast: false
1818
matrix:
19-
build_type: [Debug, Release, MinSizeRel]
19+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022, windows-2025, macos-14]
2020
include:
2121
# TODO: add linux gcc when it is fixed
2222
- os: ubuntu-24.04
@@ -96,7 +96,7 @@ jobs:
9696
cmake -B ${{ steps.strings.outputs.build-output-dir }}
9797
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9898
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
99-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99+
-DCMAKE_BUILD_TYPE=Debug
100100
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101101
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
102102
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
@@ -110,7 +110,6 @@ jobs:
110110
cmake
111111
--build ${{ steps.strings.outputs.build-output-dir }}
112112
--parallel
113-
--config MinSizeRel
114113
--target libc
115114
116115
- name: Test

clang/include/clang-c/FatalErrorHandler.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@
1111
#define LLVM_CLANG_C_FATAL_ERROR_HANDLER_H
1212

1313
#include "clang-c/ExternC.h"
14+
#include "clang-c/Platform.h"
1415

1516
LLVM_CLANG_C_EXTERN_C_BEGIN
1617

1718
/**
1819
* Installs error handler that prints error message to stderr and calls abort().
1920
* Replaces currently installed error handler (if any).
2021
*/
21-
void clang_install_aborting_llvm_fatal_error_handler(void);
22+
CINDEX_LINKAGE void clang_install_aborting_llvm_fatal_error_handler(void);
2223

2324
/**
2425
* Removes currently installed error handler (if any).
2526
* If no error handler is intalled, the default strategy is to print error
2627
* message to stderr and call exit(1).
2728
*/
28-
void clang_uninstall_llvm_fatal_error_handler(void);
29+
CINDEX_LINKAGE void clang_uninstall_llvm_fatal_error_handler(void);
2930

3031
LLVM_CLANG_C_EXTERN_C_END
3132

clang/include/clang-c/Platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LLVM_CLANG_C_EXTERN_C_BEGIN
2222
#ifndef CINDEX_NO_EXPORTS
2323
#define CINDEX_EXPORTS
2424
#endif
25-
#ifdef _WIN32
25+
#if defined(_WIN32) || defined(__CYGWIN__)
2626
#ifdef CINDEX_EXPORTS
2727
#ifdef _CINDEX_LIB_
2828
#define CINDEX_LINKAGE __declspec(dllexport)

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 316 additions & 325 deletions
Large diffs are not rendered by default.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,26 @@ class CodeGenOptionsBase {
4141
friend class CompilerInvocationBase;
4242

4343
public:
44-
#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
45-
#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
44+
/// For ASTs produced with different option value, signifies their level of
45+
/// compatibility.
46+
enum class CompatibilityKind {
47+
/// Does affect the construction of the AST in a way that does prevent
48+
/// module interoperability.
49+
Affecting,
50+
/// Does not affect the construction of the AST in any way (that is, the
51+
/// value can be different between an implicit module and the user of that
52+
/// module).
53+
Benign,
54+
};
55+
56+
#define CODEGENOPT(Name, Bits, Default, Compatibility) unsigned Name : Bits;
57+
#define ENUM_CODEGENOPT(Name, Type, Bits, Default, Compatibility)
4658
#include "clang/Basic/CodeGenOptions.def"
4759

4860
protected:
49-
#define CODEGENOPT(Name, Bits, Default)
50-
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
61+
#define CODEGENOPT(Name, Bits, Default, Compatibility)
62+
#define ENUM_CODEGENOPT(Name, Type, Bits, Default, Compatibility) \
63+
unsigned Name : Bits;
5164
#include "clang/Basic/CodeGenOptions.def"
5265
};
5366

@@ -507,9 +520,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
507520

508521
public:
509522
// Define accessors/mutators for code generation options of enumeration type.
510-
#define CODEGENOPT(Name, Bits, Default)
511-
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
512-
Type get##Name() const { return static_cast<Type>(Name); } \
523+
#define CODEGENOPT(Name, Bits, Default, Compatibility)
524+
#define ENUM_CODEGENOPT(Name, Type, Bits, Default, Compatibility) \
525+
Type get##Name() const { return static_cast<Type>(Name); } \
513526
void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
514527
#include "clang/Basic/CodeGenOptions.def"
515528

clang/include/clang/Basic/DebugOptions.def

Lines changed: 59 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -12,143 +12,122 @@
1212
// options that have enumeration type), and VALUE_DEBUGOPT (is a debug option
1313
// that describes a value rather than a flag).
1414
//
15-
// BENIGN_ variants of the macros are used to describe options that do not
16-
// affect the generated PCM.
17-
//
1815
//===----------------------------------------------------------------------===//
1916
#ifndef DEBUGOPT
20-
#define DEBUGOPT(Name, Bits, Default) \
21-
CODEGENOPT(Name, Bits, Default)
17+
#define DEBUGOPT(Name, Bits, Default, Compatibility) \
18+
CODEGENOPT(Name, Bits, Default, Compatibility)
2219
#endif
2320

2421
#ifndef VALUE_DEBUGOPT
25-
# define VALUE_DEBUGOPT(Name, Bits, Default) \
26-
VALUE_CODEGENOPT(Name, Bits, Default)
22+
# define VALUE_DEBUGOPT(Name, Bits, Default, Compatibility) \
23+
VALUE_CODEGENOPT(Name, Bits, Default, Compatibility)
2724
#endif
2825

2926
#ifndef ENUM_DEBUGOPT
30-
# define ENUM_DEBUGOPT(Name, Type, Bits, Default) \
31-
ENUM_CODEGENOPT(Name, Type, Bits, Default)
32-
#endif
33-
34-
#ifndef BENIGN_DEBUGOPT
35-
#define BENIGN_DEBUGOPT(Name, Bits, Default) \
36-
DEBUGOPT(Name, Bits, Default)
37-
#endif
38-
39-
#ifndef BENIGN_VALUE_DEBUGOPT
40-
# define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default) \
41-
VALUE_DEBUGOPT(Name, Bits, Default)
42-
#endif
43-
44-
#ifndef BENIGN_ENUM_DEBUGOPT
45-
# define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default) \
46-
ENUM_DEBUGOPT(Name, Type, Bits, Default)
27+
# define ENUM_DEBUGOPT(Name, Type, Bits, Default, Compatibility) \
28+
ENUM_CODEGENOPT(Name, Type, Bits, Default, Compatibility)
4729
#endif
4830

49-
BENIGN_ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2,
50-
llvm::DebugCompressionType::None)
51-
DEBUGOPT(Dwarf64, 1, 0) ///< -gdwarf64.
52-
BENIGN_DEBUGOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation
53-
///< verify each (it means
54-
///< check the original debug
55-
///< info metadata
56-
///< preservation).
57-
BENIGN_DEBUGOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame
58-
///< is enabled.
31+
ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2,
32+
llvm::DebugCompressionType::None, Benign)
33+
DEBUGOPT(Dwarf64, 1, 0, Affecting) ///< -gdwarf64.
34+
DEBUGOPT(EnableDIPreservationVerify, 1, 0, Benign) ///< Enable di preservation
35+
///< verify each (it means
36+
///< check the original debug
37+
///< info metadata
38+
///< preservation).
39+
DEBUGOPT(ForceDwarfFrameSection , 1, 0, Benign) ///< Set when -fforce-dwarf-frame
40+
///< is enabled.
5941

6042
///< Set when -femit-dwarf-unwind is passed.
61-
BENIGN_ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2,
62-
llvm::EmitDwarfUnwindType::Default)
43+
ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2,
44+
llvm::EmitDwarfUnwindType::Default, Benign)
6345

64-
BENIGN_DEBUGOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm
65-
///< is enabled.
46+
DEBUGOPT(NoDwarfDirectoryAsm , 1, 0, Benign) ///< Set when -fno-dwarf-directory-asm
47+
///< is enabled.
6648

67-
BENIGN_DEBUGOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain
68-
///< inline line tables.
49+
DEBUGOPT(NoInlineLineTables, 1, 0, Benign) ///< Whether debug info should contain
50+
///< inline line tables.
6951

70-
DEBUGOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info.
71-
DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0) ///< Omit unreferenced member
72-
///< functions in type debug info.
52+
DEBUGOPT(DebugStrictDwarf, 1, 1, Affecting) ///< Whether or not to use strict DWARF info.
53+
DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0, Affecting) ///< Omit unreferenced member
54+
///< functions in type debug info.
7355

7456
/// Control the Assignment Tracking debug info feature.
75-
BENIGN_ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2,
76-
AssignmentTrackingOpts::Disabled)
57+
ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2,
58+
AssignmentTrackingOpts::Disabled, Benign)
7759

7860
/// Whether or not to use Key Instructions to determine breakpoint locations.
79-
BENIGN_DEBUGOPT(DebugKeyInstructions, 1, 0)
61+
DEBUGOPT(DebugKeyInstructions, 1, 0, Benign)
8062

81-
DEBUGOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information
82-
///< in debug info.
63+
DEBUGOPT(DebugColumnInfo, 1, 0, Affecting) ///< Whether or not to use column information
64+
///< in debug info.
8365

84-
DEBUGOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain
85-
///< external references to a PCH or module.
66+
DEBUGOPT(DebugTypeExtRefs, 1, 0, Affecting) ///< Whether or not debug info should contain
67+
///< external references to a PCH or module.
8668

87-
DEBUGOPT(DebugExplicitImport, 1, 0) ///< Whether or not debug info should
88-
///< contain explicit imports for
89-
///< anonymous namespaces
69+
DEBUGOPT(DebugExplicitImport, 1, 0, Affecting) ///< Whether or not debug info should
70+
///< contain explicit imports for
71+
///< anonymous namespaces
9072

9173
/// Set debug info source file hashing algorithm.
92-
ENUM_DEBUGOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5)
93-
94-
DEBUGOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the
95-
///< skeleton CU to allow for symbolication
96-
///< of inline stack frames without .dwo files.
97-
DEBUGOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete
98-
///< template parameter descriptions in
99-
///< forward declarations (versus just
100-
///< including them in the name).
74+
ENUM_DEBUGOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5, Affecting)
75+
76+
DEBUGOPT(SplitDwarfInlining, 1, 1, Affecting) ///< Whether to include inlining info in the
77+
///< skeleton CU to allow for symbolication
78+
///< of inline stack frames without .dwo files.
79+
DEBUGOPT(DebugFwdTemplateParams, 1, 0, Affecting) ///< Whether to emit complete
80+
///< template parameter descriptions in
81+
///< forward declarations (versus just
82+
///< including them in the name).
10183
ENUM_DEBUGOPT(DebugSimpleTemplateNames,
10284
llvm::codegenoptions::DebugTemplateNamesKind, 2,
103-
llvm::codegenoptions::DebugTemplateNamesKind::Full)
85+
llvm::codegenoptions::DebugTemplateNamesKind::Full, Affecting)
10486
///< Whether to emit template parameters in the textual names of
10587
///< template specializations.
106-
///< Implies DebugFwdTemplateNames to allow decorated names to be
107-
///< reconstructed when needed.
88+
///< Implies DebugFwdTemplateNames to allow decorated names to be
89+
///< reconstructed when needed.
10890

10991
/// The kind of generated debug info.
11092
ENUM_DEBUGOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4,
111-
llvm::codegenoptions::NoDebugInfo)
93+
llvm::codegenoptions::NoDebugInfo, Affecting)
11294

11395
/// Whether to generate macro debug info.
114-
DEBUGOPT(MacroDebugInfo, 1, 0)
96+
DEBUGOPT(MacroDebugInfo, 1, 0, Affecting)
11597

11698
/// Tune the debug info for this debugger.
11799
ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3,
118-
llvm::DebuggerKind::Default)
100+
llvm::DebuggerKind::Default, Affecting)
119101

120102
/// Dwarf version. Version zero indicates to LLVM that no DWARF should be
121103
/// emitted.
122-
VALUE_DEBUGOPT(DwarfVersion, 3, 0)
104+
VALUE_DEBUGOPT(DwarfVersion, 3, 0, Affecting)
123105

124106
/// Whether we should emit CodeView debug information. It's possible to emit
125107
/// CodeView and DWARF into the same object.
126-
DEBUGOPT(EmitCodeView, 1, 0)
108+
DEBUGOPT(EmitCodeView, 1, 0, Affecting)
127109

128110
/// Whether to emit the .debug$H section containing hashes of CodeView types.
129-
DEBUGOPT(CodeViewGHash, 1, 0)
111+
DEBUGOPT(CodeViewGHash, 1, 0, Affecting)
130112

131113
/// Whether to emit the compiler path and command line into the CodeView debug information.
132-
DEBUGOPT(CodeViewCommandLine, 1, 0)
114+
DEBUGOPT(CodeViewCommandLine, 1, 0, Affecting)
133115

134116
/// Whether emit extra debug info for sample pgo profile collection.
135-
DEBUGOPT(DebugInfoForProfiling, 1, 0)
117+
DEBUGOPT(DebugInfoForProfiling, 1, 0, Affecting)
136118

137119
/// Whether to emit DW_TAG_template_alias for template aliases.
138-
DEBUGOPT(DebugTemplateAlias, 1, 0)
120+
DEBUGOPT(DebugTemplateAlias, 1, 0, Affecting)
139121

140122
/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames.
141-
DEBUGOPT(DebugNameTable, 2, 0)
123+
DEBUGOPT(DebugNameTable, 2, 0, Affecting)
142124

143125
/// Whether to use DWARF base address specifiers in .debug_ranges.
144-
DEBUGOPT(DebugRangesBaseAddress, 1, 0)
126+
DEBUGOPT(DebugRangesBaseAddress, 1, 0, Affecting)
145127

146128
/// Whether to embed source in DWARF debug line section.
147-
DEBUGOPT(EmbedSource, 1, 0)
129+
DEBUGOPT(EmbedSource, 1, 0, Affecting)
148130

149131
#undef DEBUGOPT
150132
#undef ENUM_DEBUGOPT
151133
#undef VALUE_DEBUGOPT
152-
#undef BENIGN_DEBUGOPT
153-
#undef BENIGN_ENUM_DEBUGOPT
154-
#undef BENIGN_VALUE_DEBUGOPT

0 commit comments

Comments
 (0)