Skip to content

Commit d462dc1

Browse files
committed
Merge branch 'sycl' into victor/nvptx-amdgcn-splitmodule
2 parents 84966b2 + c121bbb commit d462dc1

File tree

2,755 files changed

+95561
-36445
lines changed

Some content is hidden

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

2,755 files changed

+95561
-36445
lines changed

buildbot/configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def do_configure(args):
1515

1616
llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw'
1717

18+
if args.llvm_external_projects:
19+
llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";")
20+
1821
llvm_dir = os.path.join(abs_src_dir, "llvm")
1922
sycl_dir = os.path.join(abs_src_dir, "sycl")
2023
spirv_dir = os.path.join(abs_src_dir, "llvm-spirv")
@@ -182,6 +185,7 @@ def main():
182185
parser.add_argument("--libcxx-include", metavar="LIBCXX_INCLUDE_PATH", help="libcxx include path")
183186
parser.add_argument("--libcxx-library", metavar="LIBCXX_LIBRARY_PATH", help="libcxx library path")
184187
parser.add_argument("--use-lld", action="store_true", help="Use LLD linker for build")
188+
parser.add_argument("--llvm-external-projects", help="Add external projects to build. Add as comma seperated list.")
185189
args = parser.parse_args()
186190

187191
print("args:{}".format(args))

clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,35 @@ void recordFixes(const VarDecl &Var, ASTContext &Context,
3939
}
4040
}
4141

42+
llvm::Optional<SourceLocation> firstLocAfterNewLine(SourceLocation Loc,
43+
SourceManager &SM) {
44+
bool Invalid;
45+
const char *TextAfter = SM.getCharacterData(Loc, &Invalid);
46+
if (Invalid) {
47+
return llvm::None;
48+
}
49+
size_t Offset = std::strcspn(TextAfter, "\n");
50+
return Loc.getLocWithOffset(TextAfter[Offset] == '\0' ? Offset : Offset + 1);
51+
}
52+
4253
void recordRemoval(const DeclStmt &Stmt, ASTContext &Context,
4354
DiagnosticBuilder &Diagnostic) {
44-
// Attempt to remove the whole line until the next non-comment token.
45-
auto Tok = utils::lexer::findNextTokenSkippingComments(
46-
Stmt.getEndLoc(), Context.getSourceManager(), Context.getLangOpts());
47-
if (Tok) {
48-
Diagnostic << FixItHint::CreateRemoval(SourceRange(
49-
Stmt.getBeginLoc(), Tok->getLocation().getLocWithOffset(-1)));
55+
auto &SM = Context.getSourceManager();
56+
// Attempt to remove trailing comments as well.
57+
auto Tok = utils::lexer::findNextTokenSkippingComments(Stmt.getEndLoc(), SM,
58+
Context.getLangOpts());
59+
llvm::Optional<SourceLocation> PastNewLine =
60+
firstLocAfterNewLine(Stmt.getEndLoc(), SM);
61+
if (Tok && PastNewLine) {
62+
auto BeforeFirstTokenAfterComment = Tok->getLocation().getLocWithOffset(-1);
63+
// Remove until the end of the line or the end of a trailing comment which
64+
// ever comes first.
65+
auto End =
66+
SM.isBeforeInTranslationUnit(*PastNewLine, BeforeFirstTokenAfterComment)
67+
? *PastNewLine
68+
: BeforeFirstTokenAfterComment;
69+
Diagnostic << FixItHint::CreateRemoval(
70+
SourceRange(Stmt.getBeginLoc(), End));
5071
} else {
5172
Diagnostic << FixItHint::CreateRemoval(Stmt.getSourceRange());
5273
}
@@ -147,6 +168,7 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
147168
return compoundStmt(
148169
forEachDescendant(
149170
declStmt(
171+
unless(has(decompositionDecl())),
150172
has(varDecl(hasLocalStorage(),
151173
hasType(qualType(
152174
hasCanonicalType(allOf(

clang-tools-extra/clang-tidy/readability/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ add_clang_library(clangTidyReadabilityModule
4040
StaticAccessedThroughInstanceCheck.cpp
4141
StaticDefinitionInAnonymousNamespaceCheck.cpp
4242
StringCompareCheck.cpp
43+
SuspiciousCallArgumentCheck.cpp
4344
UniqueptrDeleteReleaseCheck.cpp
4445
UppercaseLiteralSuffixCheck.cpp
4546
UseAnyOfAllOfCheck.cpp

clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "StaticAccessedThroughInstanceCheck.h"
4444
#include "StaticDefinitionInAnonymousNamespaceCheck.h"
4545
#include "StringCompareCheck.h"
46+
#include "SuspiciousCallArgumentCheck.h"
4647
#include "UniqueptrDeleteReleaseCheck.h"
4748
#include "UppercaseLiteralSuffixCheck.h"
4849
#include "UseAnyOfAllOfCheck.h"
@@ -122,6 +123,8 @@ class ReadabilityModule : public ClangTidyModule {
122123
"readability-redundant-string-init");
123124
CheckFactories.registerCheck<SimplifyBooleanExprCheck>(
124125
"readability-simplify-boolean-expr");
126+
CheckFactories.registerCheck<SuspiciousCallArgumentCheck>(
127+
"readability-suspicious-call-argument");
125128
CheckFactories.registerCheck<UniqueptrDeleteReleaseCheck>(
126129
"readability-uniqueptr-delete-release");
127130
CheckFactories.registerCheck<UppercaseLiteralSuffixCheck>(

0 commit comments

Comments
 (0)