Skip to content

Commit 4e7b5d5

Browse files
committed
Merge from 'main' to 'sycl-web' (#7)
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaType.cpp
2 parents 61266eb + bc7cc20 commit 4e7b5d5

File tree

187 files changed

+12681
-4824
lines changed

Some content is hidden

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

187 files changed

+12681
-4824
lines changed

clang-tools-extra/clangd/Transport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H_
1919
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H_
2020

21-
#include "Features.h"
2221
#include "llvm/ADT/StringRef.h"
2322
#include "llvm/Support/JSON.h"
2423
#include "llvm/Support/raw_ostream.h"

clang-tools-extra/clangd/index/remote/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if (CLANGD_ENABLE_REMOTE)
1414
)
1515
include_directories(${CMAKE_CURRENT_BINARY_DIR})
1616
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../)
17+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../)
1718

1819
# FIXME(kirillbobyrev): target_compile_definitions is not working with
1920
# add_clang_library for some reason. Is there any way to make this

clang-tools-extra/clangd/tool/ClangdMain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// Must be before Transport.h include.
10+
#include "Features.h"
11+
912
#include "ClangdLSPServer.h"
1013
#include "CodeComplete.h"
1114
#include "Config.h"
1215
#include "ConfigProvider.h"
13-
#include "Features.h"
1416
#include "PathMapping.h"
1517
#include "Protocol.h"
1618
#include "TidyProvider.h"

clang/include/clang/AST/Expr.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,11 +3039,22 @@ class CallExpr : public Expr {
30393039
}
30403040

30413041
/// setArg - Set the specified argument.
3042+
/// ! the dependence bits might be stale after calling this setter, it is
3043+
/// *caller*'s responsibility to recompute them by calling
3044+
/// computeDependence().
30423045
void setArg(unsigned Arg, Expr *ArgExpr) {
30433046
assert(Arg < getNumArgs() && "Arg access out of range!");
30443047
getArgs()[Arg] = ArgExpr;
30453048
}
30463049

3050+
/// Compute and set dependence bits.
3051+
void computeDependence() {
3052+
setDependence(clang::computeDependence(
3053+
this, llvm::makeArrayRef(
3054+
reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START),
3055+
getNumPreArgs())));
3056+
}
3057+
30473058
/// Reduce the number of arguments in this call expression. This is used for
30483059
/// example during error recovery to drop extra arguments. There is no way
30493060
/// to perform the opposite because: 1.) We don't track how much storage

clang/include/clang/Basic/AttributeCommonInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ class AttributeCommonInfo {
155155

156156
bool isC2xAttribute() const { return SyntaxUsed == AS_C2x; }
157157

158+
/// The attribute is spelled [[]] in either C or C++ mode, including standard
159+
/// attributes spelled with a keyword, like alignas.
160+
bool isStandardAttributeSyntax() const {
161+
return isCXX11Attribute() || isC2xAttribute();
162+
}
163+
158164
bool isKeywordAttribute() const {
159165
return SyntaxUsed == AS_Keyword || SyntaxUsed == AS_ContextSensitiveKeyword;
160166
}

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6533,12 +6533,6 @@ def warn_pessimizing_move_on_initialization : Warning<
65336533
InGroup<PessimizingMove>, DefaultIgnore;
65346534
def note_remove_move : Note<"remove std::move call here">;
65356535

6536-
def warn_return_std_move : Warning<
6537-
"local variable %0 will be copied despite being %select{returned|thrown}1 by name">,
6538-
InGroup<ReturnStdMove>, DefaultIgnore;
6539-
def note_add_std_move : Note<
6540-
"call 'std::move' explicitly to avoid copying">;
6541-
65426536
def warn_string_plus_int : Warning<
65436537
"adding %0 to a string does not append to the string">,
65446538
InGroup<StringPlusInt>;

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5018,8 +5018,7 @@ class Sema final {
50185018
bool isCopyElidable() const { return S == MoveEligibleAndCopyElidable; }
50195019
};
50205020
NamedReturnInfo getNamedReturnInfo(Expr *&E, bool ForceCXX2b = false);
5021-
NamedReturnInfo getNamedReturnInfo(const VarDecl *VD,
5022-
bool ForceCXX20 = false);
5021+
NamedReturnInfo getNamedReturnInfo(const VarDecl *VD);
50235022
const VarDecl *getCopyElisionCandidate(NamedReturnInfo &Info,
50245023
QualType ReturnType);
50255024

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ CallExpr::CallExpr(StmtClass SC, Expr *Fn, ArrayRef<Expr *> PreArgs,
14531453
for (unsigned I = Args.size(); I != NumArgs; ++I)
14541454
setArg(I, nullptr);
14551455

1456-
setDependence(computeDependence(this, PreArgs));
1456+
this->computeDependence();
14571457

14581458
CallExprBits.HasFPFeatures = FPFeatures.requiresTrailingStorage();
14591459
if (hasStoredFPFeatures())

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,8 +1482,8 @@ void UnwrappedLineParser::parseStructuralElement() {
14821482
}
14831483
case tok::equal:
14841484
// Fat arrows (=>) have tok::TokenKind tok::equal but TokenType
1485-
// TT_FatArrow. The always start an expression or a child block if
1486-
// followed by a curly.
1485+
// TT_FatArrow. They always start an expression or a child block if
1486+
// followed by a curly brace.
14871487
if (FormatTok->is(TT_FatArrow)) {
14881488
nextToken();
14891489
if (FormatTok->is(tok::l_brace)) {
@@ -1790,14 +1790,20 @@ bool UnwrappedLineParser::parseBracedList(bool ContinueOnSemicolons,
17901790
bool HasError = false;
17911791

17921792
// FIXME: Once we have an expression parser in the UnwrappedLineParser,
1793-
// replace this by using parseAssigmentExpression() inside.
1793+
// replace this by using parseAssignmentExpression() inside.
17941794
do {
17951795
if (Style.isCSharp()) {
1796+
// Fat arrows (=>) have tok::TokenKind tok::equal but TokenType
1797+
// TT_FatArrow. They always start an expression or a child block if
1798+
// followed by a curly brace.
17961799
if (FormatTok->is(TT_FatArrow)) {
17971800
nextToken();
1798-
// Fat arrows can be followed by simple expressions or by child blocks
1799-
// in curly braces.
18001801
if (FormatTok->is(tok::l_brace)) {
1802+
// C# may break after => if the next character is a newline.
1803+
if (Style.isCSharp() && Style.BraceWrapping.AfterFunction == true) {
1804+
// calling `addUnwrappedLine()` here causes odd parsing errors.
1805+
FormatTok->MustBreakBefore = true;
1806+
}
18011807
parseChildBlock();
18021808
continue;
18031809
}
@@ -1927,6 +1933,12 @@ void UnwrappedLineParser::parseParens() {
19271933
parseBracedList();
19281934
}
19291935
break;
1936+
case tok::equal:
1937+
if (Style.isCSharp() && FormatTok->is(TT_FatArrow))
1938+
parseStructuralElement();
1939+
else
1940+
nextToken();
1941+
break;
19301942
case tok::kw_class:
19311943
if (Style.Language == FormatStyle::LK_JavaScript)
19321944
parseRecord(/*ParseAsExpr=*/true);

clang/lib/Parse/Parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
12141214
// a definition. Late parsed attributes are checked at the end.
12151215
if (Tok.isNot(tok::equal)) {
12161216
for (const ParsedAttr &AL : D.getAttributes())
1217-
if (AL.isKnownToGCC() && !AL.isCXX11Attribute())
1217+
if (AL.isKnownToGCC() && !AL.isStandardAttributeSyntax())
12181218
Diag(AL.getLoc(), diag::warn_attribute_on_function_definition) << AL;
12191219
}
12201220

0 commit comments

Comments
 (0)