Skip to content

Commit 816a237

Browse files
author
Georgios Rokos
committed
Merge from '"main"' to '"sycl-web"' (114 commits)
CONFLICT (content): Merge conflict in clang/test/CodeGenCXX/attr-annotate.cpp
2 parents 11a1f44 + 121b225 commit 816a237

File tree

360 files changed

+11896
-2045
lines changed

Some content is hidden

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

360 files changed

+11896
-2045
lines changed

clang/docs/ClangFormattedStatus.rst

Lines changed: 156 additions & 151 deletions
Large diffs are not rendered by default.

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Major New Features
5151
Improvements to Clang's diagnostics
5252
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5353

54-
- ...
54+
- -Wbitwise-instead-of-logical (part of -Wbool-operation) warns about use of bitwise operators with boolean operands which have side effects.
5555

5656
Non-comprehensive list of changes in this release
5757
-------------------------------------------------
@@ -121,6 +121,7 @@ C Language Changes in Clang
121121
`P2362 <wg21.link/P2362>`_.
122122
- Support for ``__attribute__((error("")))`` and
123123
``__attribute__((warning("")))`` function attributes have been added.
124+
- The maximum allowed alignment has been increased from 2^29 to 2^32.
124125

125126
C++ Language Changes in Clang
126127
-----------------------------

clang/docs/tools/clang-formatted-files.txt

Lines changed: 39 additions & 14 deletions
Large diffs are not rendered by default.

clang/docs/tools/generate_formatted_state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def get_style(count, passed):
3838
.. raw:: html
3939
4040
<style type="text/css">
41-
.none {{ background-color: #FFCC99 }}
42-
.part {{ background-color: #FFFF99 }}
43-
.good {{ background-color: #2CCCFF }}
4441
.total {{ font-weight: bold; }}
42+
.none {{ background-color: #FFFF99; height: 20px; display: inline-block; width: 120px; text-align: center; border-radius: 5px; color: #000000; font-family="Verdana,Geneva,DejaVu Sans,sans-serif" }}
43+
.part {{ background-color: #FFCC99; height: 20px; display: inline-block; width: 120px; text-align: center; border-radius: 5px; color: #000000; font-family="Verdana,Geneva,DejaVu Sans,sans-serif" }}
44+
.good {{ background-color: #2CCCFF; height: 20px; display: inline-block; width: 120px; text-align: center; border-radius: 5px; color: #000000; font-family="Verdana,Geneva,DejaVu Sans,sans-serif" }}
4545
</style>
4646
4747
.. role:: none

clang/include/clang/Analysis/CFG.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@ class CFG {
13371337
const CFGBlock * getIndirectGotoBlock() const { return IndirectGotoBlock; }
13381338

13391339
using try_block_iterator = std::vector<const CFGBlock *>::const_iterator;
1340+
using try_block_range = llvm::iterator_range<try_block_iterator>;
13401341

13411342
try_block_iterator try_blocks_begin() const {
13421343
return TryDispatchBlocks.begin();
@@ -1346,6 +1347,10 @@ class CFG {
13461347
return TryDispatchBlocks.end();
13471348
}
13481349

1350+
try_block_range try_blocks() const {
1351+
return try_block_range(try_blocks_begin(), try_blocks_end());
1352+
}
1353+
13491354
void addTryDispatchBlock(const CFGBlock *block) {
13501355
TryDispatchBlocks.push_back(block);
13511356
}

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,9 @@ def warn_pragma_expected_integer : Warning<
11161116
def warn_pragma_ms_struct : Warning<
11171117
"incorrect use of '#pragma ms_struct on|off' - ignored">,
11181118
InGroup<IgnoredPragmas>;
1119+
def warn_pragma_ms_fenv_access : Warning<
1120+
"incorrect use of '#pragma fenv_access (on|off)' - ignored">,
1121+
InGroup<IgnoredPragmas>;
11191122
def warn_pragma_extra_tokens_at_eol : Warning<
11201123
"extra tokens at end of '#pragma %0' - ignored">,
11211124
InGroup<IgnoredPragmas>;
@@ -1181,9 +1184,6 @@ def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
11811184
// The C standard 7.6.1p2 says "The [FENV_ACCESS] pragma shall occur either
11821185
// outside external declarations or preceding all explicit declarations and
11831186
// statements inside a compound statement.
1184-
def err_pragma_stdc_fenv_access_scope : Error<
1185-
"'#pragma STDC FENV_ACCESS' can only appear at file scope or at the start of"
1186-
" a compound statement">;
11871187
def warn_stdc_fenv_round_not_supported :
11881188
Warning<"pragma STDC FENV_ROUND is not supported">,
11891189
InGroup<UnknownPragmas>;

clang/include/clang/Basic/TokenKinds.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,11 @@ PRAGMA_ANNOTATION(pragma_redefine_extname)
836836
// handles them.
837837
PRAGMA_ANNOTATION(pragma_fp_contract)
838838

839-
// Annotation for #pragma STDC FENV_ACCESS
839+
// Annotations for #pragma STDC FENV_ACCESS and #pragma fenv_access (MS compat)
840840
// The lexer produces these so that they only take effect when the parser
841841
// handles them.
842842
PRAGMA_ANNOTATION(pragma_fenv_access)
843+
PRAGMA_ANNOTATION(pragma_fenv_access_ms)
843844

844845
// Annotation for #pragma STDC FENV_ROUND
845846
// The lexer produces these so that they only take effect when the parser

clang/include/clang/Parse/Parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class Parser : public CodeCompletionHandler {
196196
std::unique_ptr<PragmaHandler> MSRuntimeChecks;
197197
std::unique_ptr<PragmaHandler> MSIntrinsic;
198198
std::unique_ptr<PragmaHandler> MSOptimize;
199+
std::unique_ptr<PragmaHandler> MSFenvAccess;
199200
std::unique_ptr<PragmaHandler> CUDAForceHostDeviceHandler;
200201
std::unique_ptr<PragmaHandler> OptimizeHandler;
201202
std::unique_ptr<PragmaHandler> LoopHintHandler;

clang/lib/Analysis/CFG.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,8 @@ CFGBlock *CFGBuilder::VisitChooseExpr(ChooseExpr *C,
27112711
return addStmt(C->getCond());
27122712
}
27132713

2714-
CFGBlock *CFGBuilder::VisitCompoundStmt(CompoundStmt *C, bool ExternallyDestructed) {
2714+
CFGBlock *CFGBuilder::VisitCompoundStmt(CompoundStmt *C,
2715+
bool ExternallyDestructed) {
27152716
LocalScope::const_iterator scopeBeginPos = ScopePos;
27162717
addLocalScopeForStmt(C);
27172718

@@ -2723,11 +2724,10 @@ CFGBlock *CFGBuilder::VisitCompoundStmt(CompoundStmt *C, bool ExternallyDestruct
27232724

27242725
CFGBlock *LastBlock = Block;
27252726

2726-
for (CompoundStmt::reverse_body_iterator I=C->body_rbegin(), E=C->body_rend();
2727-
I != E; ++I ) {
2727+
for (Stmt *S : llvm::reverse(C->body())) {
27282728
// If we hit a segment of code just containing ';' (NullStmts), we can
27292729
// get a null block back. In such cases, just use the LastBlock
2730-
CFGBlock *newBlock = Visit(*I, AddStmtChoice::AlwaysAdd,
2730+
CFGBlock *newBlock = Visit(S, AddStmtChoice::AlwaysAdd,
27312731
ExternallyDestructed);
27322732

27332733
if (newBlock)
@@ -3124,9 +3124,9 @@ CFGBlock *CFGBuilder::VisitReturnStmt(Stmt *S) {
31243124
if (Expr *O = RS->getRetValue())
31253125
return Visit(O, AddStmtChoice::AlwaysAdd, /*ExternallyDestructed=*/true);
31263126
return Block;
3127-
} else { // co_return
3128-
return VisitChildren(S);
31293127
}
3128+
// co_return
3129+
return VisitChildren(S);
31303130
}
31313131

31323132
CFGBlock *CFGBuilder::VisitSEHExceptStmt(SEHExceptStmt *ES) {

clang/lib/Analysis/ReachableCode.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ static bool isConfigurationValue(const Stmt *S,
227227
if (IncludeIntegers) {
228228
if (SilenceableCondVal && !SilenceableCondVal->getBegin().isValid())
229229
*SilenceableCondVal = E->getSourceRange();
230-
return WrappedInParens || isExpandedFromConfigurationMacro(E, PP, IgnoreYES_NO);
230+
return WrappedInParens ||
231+
isExpandedFromConfigurationMacro(E, PP, IgnoreYES_NO);
231232
}
232233
return false;
233234
}
@@ -530,12 +531,11 @@ unsigned DeadCodeScan::scanBackwards(const clang::CFGBlock *Start,
530531
// earliest location.
531532
if (!DeferredLocs.empty()) {
532533
llvm::array_pod_sort(DeferredLocs.begin(), DeferredLocs.end(), SrcCmp);
533-
for (DeferredLocsTy::iterator I = DeferredLocs.begin(),
534-
E = DeferredLocs.end(); I != E; ++I) {
535-
const CFGBlock *Block = I->first;
534+
for (const auto &I : DeferredLocs) {
535+
const CFGBlock *Block = I.first;
536536
if (Reachable[Block->getBlockID()])
537537
continue;
538-
reportDeadCode(Block, I->second, CB);
538+
reportDeadCode(Block, I.second, CB);
539539
count += scanMaybeReachableFromBlock(Block, PP, Reachable);
540540
}
541541
}
@@ -694,18 +694,15 @@ void FindUnreachableCode(AnalysisDeclContext &AC, Preprocessor &PP,
694694
// If there aren't explicit EH edges, we should include the 'try' dispatch
695695
// blocks as roots.
696696
if (!AC.getCFGBuildOptions().AddEHEdges) {
697-
for (CFG::try_block_iterator I = cfg->try_blocks_begin(),
698-
E = cfg->try_blocks_end() ; I != E; ++I) {
699-
numReachable += scanMaybeReachableFromBlock(*I, PP, reachable);
700-
}
697+
for (const CFGBlock *B : cfg->try_blocks())
698+
numReachable += scanMaybeReachableFromBlock(B, PP, reachable);
701699
if (numReachable == cfg->getNumBlockIDs())
702700
return;
703701
}
704702

705703
// There are some unreachable blocks. We need to find the root blocks that
706704
// contain code that should be considered unreachable.
707-
for (CFG::iterator I = cfg->begin(), E = cfg->end(); I != E; ++I) {
708-
const CFGBlock *block = *I;
705+
for (const CFGBlock *block : *cfg) {
709706
// A block may have been marked reachable during this loop.
710707
if (reachable[block->getBlockID()])
711708
continue;

0 commit comments

Comments
 (0)