Skip to content

Commit 98f3f0b

Browse files
committed
Merge commit '1d23d60c8d0406b9163d223d2721c5e4f1932f50' into llvmspirv_pulldown
2 parents 28849bf + 1d23d60 commit 98f3f0b

File tree

1,250 files changed

+37053
-15834
lines changed

Some content is hidden

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

1,250 files changed

+37053
-15834
lines changed

bolt/tools/merge-fdata/merge-fdata.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ bool isYAML(const StringRef Filename) {
257257

258258
void mergeLegacyProfiles(const SmallVectorImpl<std::string> &Filenames) {
259259
errs() << "Using legacy profile format.\n";
260-
bool BoltedCollection = false;
261-
bool First = true;
260+
std::optional<bool> BoltedCollection;
262261
StringMap<uint64_t> Entries;
263262
for (const std::string &Filename : Filenames) {
264263
if (isYAML(Filename))
@@ -272,17 +271,18 @@ void mergeLegacyProfiles(const SmallVectorImpl<std::string> &Filenames) {
272271
StringRef Buf = MB.get()->getBuffer();
273272
// Check if the string "boltedcollection" is in the first line
274273
if (Buf.startswith("boltedcollection\n")) {
275-
if (!First && !BoltedCollection)
274+
if (!BoltedCollection.value_or(true))
276275
report_error(
277276
Filename,
278277
"cannot mix profile collected in BOLT and non-BOLT deployments");
279278
BoltedCollection = true;
280279
Buf = Buf.drop_front(17);
281280
} else {
282-
if (BoltedCollection)
281+
if (BoltedCollection.value_or(false))
283282
report_error(
284283
Filename,
285284
"cannot mix profile collected in BOLT and non-BOLT deployments");
285+
BoltedCollection = false;
286286
}
287287

288288
SmallVector<StringRef> Lines;
@@ -298,7 +298,6 @@ void mergeLegacyProfiles(const SmallVectorImpl<std::string> &Filenames) {
298298
Count += Entries.lookup(Signature);
299299
Entries.insert_or_assign(Signature, Count);
300300
}
301-
First = false;
302301
}
303302

304303
if (BoltedCollection)

clang-tools-extra/clang-tidy/add_new_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ def write_implementation(module_path, module, namespace, check_name_camel):
138138
if (!MatchedDecl->getIdentifier() || MatchedDecl->getName().startswith("awesome_"))
139139
return;
140140
diag(MatchedDecl->getLocation(), "function %%0 is insufficiently awesome")
141-
<< MatchedDecl;
142-
diag(MatchedDecl->getLocation(), "insert 'awesome'", DiagnosticIDs::Note)
141+
<< MatchedDecl
143142
<< FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
143+
diag(MatchedDecl->getLocation(), "insert 'awesome'", DiagnosticIDs::Note);
144144
}
145145
146146
} // namespace clang::tidy::%(namespace)s
@@ -293,7 +293,7 @@ def write_test(module_path, module, check_name, test_extension):
293293

294294

295295
def get_actual_filename(dirname, filename):
296-
if not os.path.isdir(dirname):
296+
if not os.path.isdir(dirname):
297297
return ''
298298
name = os.path.join(dirname, filename)
299299
if (os.path.isfile(name)):

clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
9090
// Internal linkage variable definitions are ignored for now:
9191
// const int a = 1;
9292
// static int b = 1;
93+
// namespace { int c = 1; }
9394
//
9495
// Although these might also cause ODR violations, we can be less certain and
9596
// should try to keep the false-positive rate down.
96-
//
97-
// FIXME: Should declarations in anonymous namespaces get the same treatment
98-
// as static / const declarations?
99-
if (!ND->hasExternalFormalLinkage() && !ND->isInAnonymousNamespace())
97+
if (!ND->hasExternalFormalLinkage() || ND->isInAnonymousNamespace())
10098
return;
10199

102100
if (const auto *FD = dyn_cast<FunctionDecl>(ND)) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ add_clang_library(clangTidyReadabilityModule
2929
NamedParameterCheck.cpp
3030
NamespaceCommentCheck.cpp
3131
NonConstParameterCheck.cpp
32+
OperatorsRepresentationCheck.cpp
3233
QualifiedAutoCheck.cpp
3334
ReadabilityTidyModule.cpp
3435
RedundantAccessSpecifiersCheck.cpp

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ void MisleadingIndentationCheck::missingBracesCheck(const SourceManager &SM,
104104
}
105105

106106
void MisleadingIndentationCheck::registerMatchers(MatchFinder *Finder) {
107-
Finder->addMatcher(ifStmt(hasElse(stmt())).bind("if"), this);
107+
Finder->addMatcher(
108+
ifStmt(unless(hasThen(nullStmt())), hasElse(stmt())).bind("if"), this);
108109
Finder->addMatcher(
109110
compoundStmt(has(stmt(anyOf(ifStmt(), forStmt(), whileStmt()))))
110111
.bind("compound"),

0 commit comments

Comments
 (0)