Skip to content

Commit 6cae613

Browse files
authored
Merge branch 'main' into fix_test
2 parents f64b319 + 2b3f80d commit 6cae613

File tree

208 files changed

+3044
-1140
lines changed

Some content is hidden

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

208 files changed

+3044
-1140
lines changed

.github/workflows/gha-codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
branches:
99
- main
10+
paths:
11+
- '.github/**'
1012
schedule:
1113
- cron: '30 0 * * *'
1214

.github/workflows/libclang-abi-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ jobs:
113113
./configure
114114
sudo make install
115115
- name: Download source code
116-
uses: llvm/actions/get-llvm-project-src@main
116+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
117117
with:
118118
ref: ${{ matrix.ref }}
119-
repo: ${{ matrix.repo }}
119+
repository: ${{ matrix.repo }}
120120
- name: Configure
121121
run: |
122122
mkdir install

.github/workflows/llvm-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ jobs:
101101
./configure
102102
sudo make install
103103
- name: Download source code
104-
uses: llvm/actions/get-llvm-project-src@main
104+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
105105
with:
106106
ref: ${{ matrix.ref }}
107-
repo: ${{ matrix.repo }}
107+
repository: ${{ matrix.repo }}
108108
- name: Configure
109109
run: |
110110
mkdir install

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
1+
// RUN: %check_clang_tidy %s --extra-arg=-Wno-error=incompatible-pointer-types bugprone-easily-swappable-parameters %t \
22
// RUN: -config='{CheckOptions: { \
33
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \
44
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ C/C++ Language Potentially Breaking Changes
5858

5959
- The ``__has_builtin`` function now only considers the currently active target when being used with target offloading.
6060

61+
- The ``-Wincompatible-pointer-types`` diagnostic now defaults to an error;
62+
it can still be downgraded to a warning by passing ``-Wno-error=incompatible-pointer-types``. (#GH74605)
63+
6164
C++ Specific Potentially Breaking Changes
6265
-----------------------------------------
6366
- For C++20 modules, the Reduced BMI mode will be the default option. This may introduce

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9048,7 +9048,7 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn<
90489048
"; take the address with &|"
90499049
"; remove *|"
90509050
"; remove &}3">,
9051-
InGroup<IncompatiblePointerTypes>;
9051+
InGroup<IncompatiblePointerTypes>, DefaultError;
90529052
def err_typecheck_convert_incompatible_pointer : Error<
90539053
"incompatible pointer types "
90549054
"%select{%diff{assigning to $ from $|assigning to different types}0,1"

clang/include/clang/Driver/Options.td

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4682,8 +4682,10 @@ def gdbx : Flag<["-"], "gdbx">, Group<gTune_Group>;
46824682
// Equivalent to our default dwarf version. Forces usual dwarf emission when
46834683
// CodeView is enabled.
46844684
def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>,
4685-
Visibility<[ClangOption, CLOption, DXCOption]>,
4685+
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
46864686
HelpText<"Generate source-level debug information with the default dwarf version">;
4687+
4688+
let Visibility = [ClangOption, FlangOption] in {
46874689
def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group<g_Group>,
46884690
HelpText<"Generate source-level debug information with dwarf version 2">;
46894691
def gdwarf_3 : Flag<["-"], "gdwarf-3">, Group<g_Group>,
@@ -4692,6 +4694,7 @@ def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
46924694
HelpText<"Generate source-level debug information with dwarf version 4">;
46934695
def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
46944696
HelpText<"Generate source-level debug information with dwarf version 5">;
4697+
}
46954698
def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
46964699
Visibility<[ClangOption, CC1Option, CC1AsOption]>,
46974700
HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
@@ -7633,6 +7636,8 @@ def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
76337636
def record_command_line : Separate<["-"], "record-command-line">,
76347637
HelpText<"The string to embed in the .LLVM.command.line section.">,
76357638
MarshallingInfoString<CodeGenOpts<"RecordCommandLine">>;
7639+
def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
7640+
MarshallingInfoInt<CodeGenOpts<"DwarfVersion">>;
76367641

76377642
} // let Visibility = [CC1Option, CC1AsOption, FC1Option]
76387643

@@ -7644,8 +7649,6 @@ def debug_info_macro : Flag<["-"], "debug-info-macro">,
76447649
def default_function_attr : Separate<["-"], "default-function-attr">,
76457650
HelpText<"Apply given attribute to all functions">,
76467651
MarshallingInfoStringVector<CodeGenOpts<"DefaultFunctionAttrs">>;
7647-
def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
7648-
MarshallingInfoInt<CodeGenOpts<"DwarfVersion">>;
76497652
def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
76507653
Values<"gdb,lldb,sce,dbx">,
76517654
NormalizedValuesScope<"llvm::DebuggerKind">, NormalizedValues<["GDB", "LLDB", "SCE", "DBX"]>,

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,12 +1037,15 @@ CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM)
10371037
CGM.getLangOpts().OpenMPOffloadMandatory,
10381038
/*HasRequiresReverseOffload*/ false, /*HasRequiresUnifiedAddress*/ false,
10391039
hasRequiresUnifiedSharedMemory(), /*HasRequiresDynamicAllocators*/ false);
1040+
Config.setDefaultTargetAS(
1041+
CGM.getContext().getTargetInfo().getTargetAddressSpace(LangAS::Default));
1042+
1043+
OMPBuilder.setConfig(Config);
10401044
OMPBuilder.initialize();
10411045
OMPBuilder.loadOffloadInfoMetadata(*CGM.getFileSystem(),
10421046
CGM.getLangOpts().OpenMPIsTargetDevice
10431047
? CGM.getLangOpts().OMPHostIRFile
10441048
: StringRef{});
1045-
OMPBuilder.setConfig(Config);
10461049

10471050
// The user forces the compiler to behave as if omp requires
10481051
// unified_shared_memory was given.

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,6 +4393,13 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
43934393
// object file generation and no IR generation, -gN should not be needed. So
43944394
// allow -gsplit-dwarf with either -gN or IR input.
43954395
if (IRInput || Args.hasArg(options::OPT_g_Group)) {
4396+
// FIXME: -gsplit-dwarf on AIX is currently unimplemented.
4397+
if (TC.getTriple().isOSAIX() && Args.hasArg(options::OPT_gsplit_dwarf)) {
4398+
D.Diag(diag::err_drv_unsupported_opt_for_target)
4399+
<< Args.getLastArg(options::OPT_gsplit_dwarf)->getSpelling()
4400+
<< TC.getTriple().str();
4401+
return;
4402+
}
43964403
Arg *SplitDWARFArg;
43974404
DwarfFission = getDebugFissionKind(D, Args, SplitDWARFArg);
43984405
if (DwarfFission != DwarfFissionKind::None &&

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,17 @@ void Flang::addOtherOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
134134
if (Args.hasArg(options::OPT_gN_Group)) {
135135
Arg *gNArg = Args.getLastArg(options::OPT_gN_Group);
136136
DebugInfoKind = debugLevelToInfoKind(*gNArg);
137-
} else if (Args.hasArg(options::OPT_g_Flag)) {
137+
} else if (Args.hasArg(options::OPT_g_Group)) {
138138
DebugInfoKind = llvm::codegenoptions::FullDebugInfo;
139139
} else {
140140
DebugInfoKind = llvm::codegenoptions::NoDebugInfo;
141141
}
142142
addDebugInfoKind(CmdArgs, DebugInfoKind);
143+
if (getDwarfNArg(Args)) {
144+
const unsigned DwarfVersion = getDwarfVersion(getToolChain(), Args);
145+
CmdArgs.push_back(
146+
Args.MakeArgString("-dwarf-version=" + Twine(DwarfVersion)));
147+
}
143148
}
144149

145150
void Flang::addCodegenOptions(const ArgList &Args,

0 commit comments

Comments
 (0)