Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from MaxMood96:main #148

Merged
merged 102 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
e76689e
Add self to .mailmap
zmodem Oct 12, 2021
564e082
[PowerPC] Allow MMA built-ins to accept restrict and volatile qualifi…
Sep 13, 2021
40546cb
Remove 'IgnoreDestructors = true' from cppcoreguidelines-explicit-vir…
carlosgalvezp Oct 12, 2021
67f94e5
[lldb/lua] Supplement Lua bindings for lldb module
ttyS0 Oct 12, 2021
97d67f7
[mlir][linalg] Add vector transfer lowering patters to codegen strategy.
Oct 12, 2021
444ec09
[clang] p0388 array list initialization overloads
urnathan May 21, 2021
a76cfc2
[clang-tidy] Update documentation of check bugprone-unused-return-val…
balazske Oct 12, 2021
dcd7471
[clang] p0388 conversion to incomplete array
urnathan May 20, 2021
2eb42e3
[AArch64][SVE] Add fixed type lowering for EXTRACT_SUBVECTOR
brads55 Oct 5, 2021
c8faeb1
[mlir][linalg] Add switch to disable/enable vector transfer lowering.
Oct 12, 2021
838b4a5
[DebugInfo][NFC] Move LiveDebugValues class to header
jmorse Oct 12, 2021
66e13c7
[AMDGPU] Enable load clustering in the post-RA scheduler
jayfoad Oct 12, 2021
f7ee21a
[TwoAddressInstruction] Remove ad hoc machine verification
jayfoad Oct 12, 2021
66ce101
Revert "[AMDGPU] Enable load clustering in the post-RA scheduler"
jayfoad Oct 12, 2021
6cac17e
[libcxx] [test] Make windows triples in XFAILs less specific
mstorsjo Aug 27, 2021
a76e698
[libc++] Update atomic synopsis and tests.
mordante Jun 6, 2021
55e76c7
[mlir] Limit Python dependency to Development.Module when possible.
mikeurbach Oct 11, 2021
519b350
[mlir][vector] Add folder for no-op InsertStridedSliceOp
antiagainst Oct 12, 2021
9fc35c3
[mlir][sparse] add action enum, group enums together, few asserts
aartbik Oct 12, 2021
1112b7b
[libcxx][AIX] Explicitly include localedef.h in locale.cpp
daltenty Oct 12, 2021
d9fa186
Scatter NDEBUG to fix after 838b4a533e6
jmorse Oct 12, 2021
968e273
[libc++] Use addressof to fix debug tests.
mordante Oct 10, 2021
f565488
[Clang][clang-nvlink-wrapper] Pass nvlink path to the wrapper
saiislam Oct 9, 2021
aefaf16
[TableGen] Fix both sides of '&&' are same
topperc Oct 12, 2021
57b40b5
[AST, CodeGen, Driver] Use llvm::is_contained (NFC)
kazutakahirata Oct 12, 2021
f05c95f
[flang] More work on SYSTEM_CLOCK runtime API and implementation
klausler Oct 6, 2021
098a0d8
[CSSPGO] Unblock optimizations with pseudo probe instrumentation part 3.
htyu Sep 30, 2021
fe2d053
Added OpenMP 5.0 specification based semantic checks for CRITICAL con…
NimishMishra Oct 12, 2021
7964c3e
[X86] `detectAVGPattern()`: small preparatory NFC refactor
LebedevRI Oct 12, 2021
5f4f5da
[X86] `detectAVGPattern()`: support basic case of PAVG chaining (PR52…
LebedevRI Oct 12, 2021
fae7d68
[InstCombine] add tests with nsw/nuw for mul-of-select; NFC
rotateright Oct 12, 2021
7a29496
[InstCombine] propagate no-wrap flag through select-of-mul fold
rotateright Oct 12, 2021
9cf995b
[AMDGPU] Promote generic pointer kernel arguments into global
rampitec Oct 8, 2021
f67d57c
[mlir][Shape] Add a pattern to turn extract from shape_of into tensor…
d0k Oct 12, 2021
a1d57f7
[NFC][X86] `detectAVGPattern()`: rely on `AVGSplitter()` to perform t…
LebedevRI Oct 12, 2021
bbc2fc5
[Support][ORC] Add an explicit release operation to OwningMemoryBlock.
lhames Oct 12, 2021
0902451
[NFC][X86] Add another test case for PR52131
LebedevRI Oct 12, 2021
958da65
[X86] `detectAVGPattern()`: don't require zext in the with-constant case
LebedevRI Oct 12, 2021
2cc4275
[clang/CFG] Don't explicitly add AttributedStmtClass to AlwaysAddList
nico Oct 11, 2021
532d71c
[gn build] (manually) port 67f94e5a9745
nico Oct 12, 2021
e9119a7
[gn build] Port 838b4a533e68
llvmgnsyncbot Oct 12, 2021
27bc1e6
[gn build] Port 9cf995be6bb7
llvmgnsyncbot Oct 12, 2021
f3ec9d8
[analyzer] Fix non-obvious analyzer warning: Use of zero-allocated me…
haoNoQ Oct 12, 2021
ea4a6c8
[Inline] Make sure the InlineAdvisor is correctly cleared.
mtrofin Oct 11, 2021
bdf6ba2
[FPEnv][InstSimplify] Precommit tests: Enable more folds for constrai…
kpneal Oct 12, 2021
86a4a93
[docs] [NFC] Clarify the datalayout documentation
woodruffw Oct 12, 2021
b4db2a5
[sanitizer] Fix StackDepotPrintAll
vitalybuka Oct 12, 2021
63638ed
[mlir][linalg] Enable the vector transfer lowering by default.
Oct 12, 2021
9e9803b
[libc] Add strncat and fix strcat
michaelrj-google Oct 11, 2021
2682733
Remove checks for old gcc versions for LLVM_ATTRIBUTE_*
aeubanks Oct 11, 2021
5abce56
[GlobalISel] Add support for constant vector folding of binops in CSE…
aemerson Oct 11, 2021
15692fd
[LV] Fix 2nd crash for reverse interleaved groups under mask/fold-tail.
azaks Aug 29, 2021
357b8d7
[tests] Add coverage for cases we can drop flags to propagate freeze …
preames Oct 12, 2021
04d76d3
[mlir][python] Add nameloc getter
jpienaar Oct 12, 2021
f7858e7
[flang] Fix build on FreeBSD (need size_t)
klausler Oct 12, 2021
dfa8d33
DebugInfo: Update ranges_always.ll to include more details about how …
dwblaikie Oct 11, 2021
d7e766c
DebugInfo: Add test coverage for non-zero addrx in DW_FORM_LLVM_addrx…
dwblaikie Oct 12, 2021
95e4b71
[mlir][tosa] Fix tosa average_pool2d to linalg type issue
rsuderman Oct 12, 2021
28e648b
[PowerPC] Simplify PPC codegen test pre-inc-disable.ll
RolandF77 Oct 12, 2021
0e0d3b3
[sanitizer] Fix typo in test
vitalybuka Oct 12, 2021
336e886
[sanitizer] Fix test on Windows
vitalybuka Oct 12, 2021
c24b2ad
Add extra tests for D111675
preames Oct 12, 2021
9939e56
[NFC][sanitizer] Refactor Maps into templates
vitalybuka Oct 11, 2021
2815ed5
[ORC] Shut down dispatcher in ExecutorProcessControl implementations.
lhames Oct 12, 2021
b4b9f9b
[PowerPC] Emit dcbt and dcbtst in place of their extended mnemonics o…
Conanap Oct 12, 2021
884d290
[sanitizer] Remove SpinMutexLock from stat function
vitalybuka Oct 10, 2021
6f34839
[instcombine] propagate freeze through single use poison producing fl…
preames Oct 12, 2021
38f121c
[sanitizer] Switch StackDepot to TwoLevelMap
vitalybuka Oct 11, 2021
d80a5d5
[NFC][sanitizer] Move consts into on top of the class
vitalybuka Oct 12, 2021
68d6923
[fir] Add cfg conversion pass
jeanPerier Oct 12, 2021
f09dce5
[lld] fix typos to cycle bots
nico Oct 12, 2021
5c1d356
[mlir][Linalg] Enable vectorization of explicit broadcasts
dcaballe Oct 12, 2021
eeb09fd
[mlir][Linalg] Enable vectorization of 'mul', 'and', 'or' and 'xor' r…
dcaballe Oct 12, 2021
67905bc
[sanitizer] Re-enable test on Windows
vitalybuka Oct 12, 2021
d402fb0
[NFC][sanitizer] Clang-format a line
vitalybuka Oct 12, 2021
2cadef6
[clang] Teardown new PM data structures before running codegen pipeline
aeubanks Oct 11, 2021
19b4e3c
[ORC] Call ExecutionSession::endSession in unit tests.
lhames Oct 12, 2021
f526ee5
[CUDA] Provide address space conversion builtins.
Artem-B Oct 12, 2021
adf55ac
[ORC] Call ExecutorProcessControl::disconnect in unit tests that requ…
lhames Oct 12, 2021
3ec4d4d
[NFC][sanitizer] Add a few consts
vitalybuka Oct 12, 2021
f815c2c
[sanitizer] Fix test on Windows
vitalybuka Oct 12, 2021
b6a8c69
[NFC] Rename EmitAssemblyHelper new/legacy PM methods
aeubanks Oct 12, 2021
7c97e32
[mlir][linalg] Fix generic reduction vectorization
ThomasRaoux Oct 12, 2021
ce7f8c8
[sanitizer] Remove id and replace link with u32
vitalybuka Oct 12, 2021
ca0036d
[sanitizer] Remove StackDepotReverseMap
vitalybuka Oct 12, 2021
49142dd
[flang][NFC] Address warnings from Windows build
klausler Oct 12, 2021
6ee2aa1
[flang][NFC] Document extension: scalars are trivially contiguous
klausler Oct 12, 2021
f65f830
[flang] runtime: fix output B/O/Z editing of "negative" values
klausler Oct 11, 2021
aa71f48
[mlir] update new linalg vectorization tests after vectorization fix
ThomasRaoux Oct 12, 2021
1b81581
[lldb][test] Remove Intel MPX tests
MaskRay Oct 12, 2021
c2d4fe5
[X86] Remove little support we had for MPX
MaskRay Oct 12, 2021
a6ddb7c
[mlir][linalg][bufferize][NFC] Reduce code duplication around bufferi…
matthias-springer Oct 13, 2021
02410df
[flang] Fix Windows build
klausler Oct 13, 2021
fd31620
[mlir][linalg][bufferize][NFC] Conflict detection funcs take OpOperan…
matthias-springer Oct 13, 2021
7c3a810
[mlir][linalg][bufferize] Put buffer copying in separate function
matthias-springer Oct 13, 2021
0292236
[mlir][linalg][bufferize][NFC] Simplify allocateBuffersForResults
matthias-springer Oct 13, 2021
bc1a0c2
[flang] Fix "latest-clang" build warnings
klausler Oct 13, 2021
0ee5323
[mlir][linalg][bufferize][NFC] Simplify getAliasingOpOperand signature
matthias-springer Oct 13, 2021
441485c
[mlir][linalg][bufferize][NFC] Remove InSpaceSpec from bufferizesToMe…
matthias-springer Oct 13, 2021
787eeb8
[RISCV] Optimize immediate materialisation with BCLRI
benshi001 Oct 11, 2021
ecc7f8a
[flang] Fix Windows build (take 2)
klausler Oct 13, 2021
9a70eb9
[profile] Remove emitting symbolizer markup
gulfemsavrun Oct 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<compnerd@compnerd.org> <abdulras@fb.com>
<compnerd@compnerd.org> <abdulras@google.com>
<hans@hanshq.net> <hans@chromium.org>
<i@maskray.me> <maskray@google.com>
<JCTremoulet@gmail.com> <jotrem@microsoft.com>
<qiucofan@cn.ibm.com> <qiucf@cn.ibm.com>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ class CppCoreGuidelinesModule : public ClangTidyModule {
Opts["cppcoreguidelines-non-private-member-variables-in-classes."
"IgnoreClassesWithAllMemberVariablesBeingPublic"] = "true";

Opts["cppcoreguidelines-explicit-virtual-functions."
"IgnoreDestructors"] = "true";

return Options;
}
};
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ New check aliases
Changes in existing checks
^^^^^^^^^^^^^^^^^^^^^^^^^^

- Removed default setting `cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors = "true"`,
to match the current state of the C++ Core Guidelines.


Removed checks
^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@ Options

.. option:: CheckedFunctions

Semicolon-separated list of functions to check. Defaults to
``::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty``.
This means that the calls to following functions are checked by default:
Semicolon-separated list of functions to check. The function is checked if
the name and scope matches, with any arguments.
By default the following functions are checked:
``std::async, std::launder, std::remove, std::remove_if, std::unique,
std::unique_ptr::release, std::basic_string::empty, std::vector::empty,
std::back_inserter, std::distance, std::find, std::find_if, std::inserter,
std::lower_bound, std::make_pair, std::map::count, std::map::find,
std::map::lower_bound, std::multimap::equal_range,
std::multimap::upper_bound, std::set::count, std::set::find, std::setfill,
std::setprecision, std::setw, std::upper_bound, std::vector::at,
bsearch, ferror, feof, isalnum, isalpha, isblank, iscntrl, isdigit, isgraph,
islower, isprint, ispunct, isspace, isupper, iswalnum, iswprint, iswspace,
isxdigit, memchr, memcmp, strcmp, strcoll, strncmp, strpbrk, strrchr,
strspn, strstr, wcscmp, access, bind, connect, difftime, dlsym, fnmatch,
getaddrinfo, getopt, htonl, htons, iconv_open, inet_addr, isascii, isatty,
mmap, newlocale, openat, pathconf, pthread_equal, pthread_getspecific,
pthread_mutex_trylock, readdir, readlink, recvmsg, regexec, scandir,
semget, setjmp, shm_open, shmget, sigismember, strcasecmp, strsignal,
ttyname``

- ``std::async()``. Not using the return value makes the call synchronous.
- ``std::launder()``. Not using the return value usually means that the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fexceptions
// RUN: %check_clang_tidy %s modernize-use-override,cppcoreguidelines-explicit-virtual-functions %t -- -- -fexceptions

#define ABSTRACT = 0

Expand Down Expand Up @@ -52,7 +52,7 @@ struct Base {
struct SimpleCases : public Base {
public:
virtual ~SimpleCases();
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual'
// CHECK-FIXES: {{^}} ~SimpleCases() override;

void a();
Expand Down
6 changes: 4 additions & 2 deletions clang/include/clang/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -2535,8 +2535,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl,
const ObjCMethodDecl *MethodImp);

bool UnwrapSimilarTypes(QualType &T1, QualType &T2);
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2);
bool UnwrapSimilarTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch = true);
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch = true);

/// Determine if two types are similar, according to the C++ rules. That is,
/// determine if they are the same other than qualifiers on the initial
Expand Down
17 changes: 14 additions & 3 deletions clang/include/clang/Sema/Overload.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ class Sema;
};

/// ConversionKind - The kind of implicit conversion sequence.
unsigned ConversionKind;
unsigned ConversionKind : 31;

// Whether the initializer list was of an incomplete array.
unsigned InitializerListOfIncompleteArray : 1;

/// When initializing an array or std::initializer_list from an
/// initializer-list, this is the array or std::initializer_list type being
Expand Down Expand Up @@ -573,12 +576,16 @@ class Sema;
};

ImplicitConversionSequence()
: ConversionKind(Uninitialized), InitializerListContainerType() {
: ConversionKind(Uninitialized),
InitializerListOfIncompleteArray(false),
InitializerListContainerType() {
Standard.setAsIdentityConversion();
}

ImplicitConversionSequence(const ImplicitConversionSequence &Other)
: ConversionKind(Other.ConversionKind),
InitializerListOfIncompleteArray(
Other.InitializerListOfIncompleteArray),
InitializerListContainerType(Other.InitializerListContainerType) {
switch (ConversionKind) {
case Uninitialized: break;
Expand Down Expand Up @@ -680,8 +687,12 @@ class Sema;
bool hasInitializerListContainerType() const {
return !InitializerListContainerType.isNull();
}
void setInitializerListContainerType(QualType T) {
void setInitializerListContainerType(QualType T, bool IA) {
InitializerListContainerType = T;
InitializerListOfIncompleteArray = IA;
}
bool isInitializerListOfIncompleteArray() const {
return InitializerListOfIncompleteArray;
}
QualType getInitializerListContainerType() const {
assert(hasInitializerListContainerType() &&
Expand Down
31 changes: 24 additions & 7 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5844,7 +5844,11 @@ QualType ASTContext::getUnqualifiedArrayType(QualType type,
/// Attempt to unwrap two types that may both be array types with the same bound
/// (or both be array types of unknown bound) for the purpose of comparing the
/// cv-decomposition of two types per C++ [conv.qual].
void ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2) {
///
/// \param AllowPiMismatch Allow the Pi1 and Pi2 to differ as described in
/// C++20 [conv.qual], if permitted by the current language mode.
void ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch) {
while (true) {
auto *AT1 = getAsArrayType(T1);
if (!AT1)
Expand All @@ -5856,12 +5860,21 @@ void ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2) {

// If we don't have two array types with the same constant bound nor two
// incomplete array types, we've unwrapped everything we can.
// C++20 also permits one type to be a constant array type and the other
// to be an incomplete array type.
// FIXME: Consider also unwrapping array of unknown bound and VLA.
if (auto *CAT1 = dyn_cast<ConstantArrayType>(AT1)) {
auto *CAT2 = dyn_cast<ConstantArrayType>(AT2);
if (!CAT2 || CAT1->getSize() != CAT2->getSize())
if (!((CAT2 && CAT1->getSize() == CAT2->getSize()) ||
(AllowPiMismatch && getLangOpts().CPlusPlus20 &&
isa<IncompleteArrayType>(AT2))))
return;
} else if (isa<IncompleteArrayType>(AT1)) {
if (!(isa<IncompleteArrayType>(AT2) ||
(AllowPiMismatch && getLangOpts().CPlusPlus20 &&
isa<ConstantArrayType>(AT2))))
return;
} else if (!isa<IncompleteArrayType>(AT1) ||
!isa<IncompleteArrayType>(AT2)) {
} else {
return;
}

Expand All @@ -5880,10 +5893,14 @@ void ASTContext::UnwrapSimilarArrayTypes(QualType &T1, QualType &T2) {
/// "unwraps" pointer and pointer-to-member types to compare them at each
/// level.
///
/// \param AllowPiMismatch Allow the Pi1 and Pi2 to differ as described in
/// C++20 [conv.qual], if permitted by the current language mode.
///
/// \return \c true if a pointer type was unwrapped, \c false if we reached a
/// pair of types that can't be unwrapped further.
bool ASTContext::UnwrapSimilarTypes(QualType &T1, QualType &T2) {
UnwrapSimilarArrayTypes(T1, T2);
bool ASTContext::UnwrapSimilarTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch) {
UnwrapSimilarArrayTypes(T1, T2, AllowPiMismatch);

const auto *T1PtrType = T1->getAs<PointerType>();
const auto *T2PtrType = T2->getAs<PointerType>();
Expand Down Expand Up @@ -5944,7 +5961,7 @@ bool ASTContext::hasCvrSimilarType(QualType T1, QualType T2) {
if (hasSameType(T1, T2))
return true;

if (!UnwrapSimilarTypes(T1, T2))
if (!UnwrapSimilarTypes(T1, T2, /*AllowPiMismatch*/ false))
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/CXXInheritance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ void OverridingMethods::add(unsigned OverriddenSubobject,
UniqueVirtualMethod Overriding) {
SmallVectorImpl<UniqueVirtualMethod> &SubobjectOverrides
= Overrides[OverriddenSubobject];
if (llvm::find(SubobjectOverrides, Overriding) == SubobjectOverrides.end())
if (!llvm::is_contained(SubobjectOverrides, Overriding))
SubobjectOverrides.push_back(Overriding);
}

Expand Down
8 changes: 3 additions & 5 deletions clang/lib/AST/DeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ void CXXRecordDecl::removeConversion(const NamedDecl *ConvDecl) {
for (unsigned I = 0, E = Convs.size(); I != E; ++I) {
if (Convs[I].getDecl() == ConvDecl) {
Convs.erase(I);
assert(llvm::find(Convs, ConvDecl) == Convs.end() &&
assert(!llvm::is_contained(Convs, ConvDecl) &&
"conversion was found multiple times in unresolved set");
return;
}
Expand Down Expand Up @@ -3014,8 +3014,7 @@ CXXRecordDecl *ConstructorUsingShadowDecl::getNominatedBaseClass() const {
void BaseUsingDecl::anchor() {}

void BaseUsingDecl::addShadowDecl(UsingShadowDecl *S) {
assert(std::find(shadow_begin(), shadow_end(), S) == shadow_end() &&
"declaration already in set");
assert(!llvm::is_contained(shadows(), S) && "declaration already in set");
assert(S->getIntroducer() == this);

if (FirstUsingShadow.getPointer())
Expand All @@ -3024,8 +3023,7 @@ void BaseUsingDecl::addShadowDecl(UsingShadowDecl *S) {
}

void BaseUsingDecl::removeShadowDecl(UsingShadowDecl *S) {
assert(std::find(shadow_begin(), shadow_end(), S) != shadow_end() &&
"declaration not in set");
assert(llvm::is_contained(shadows(), S) && "declaration not in set");
assert(S->getIntroducer() == this);

// Remove S from the shadow decl chain. This is O(n) but hopefully rare.
Expand Down
5 changes: 2 additions & 3 deletions clang/lib/AST/ParentMapContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,10 @@ class ParentMapContext::ParentMap::ASTVisitor
auto *Vector = NodeOrVector.template get<ParentVector *>();
// Skip duplicates for types that have memoization data.
// We must check that the type has memoization data before calling
// std::find() because DynTypedNode::operator== can't compare all
// llvm::is_contained() because DynTypedNode::operator== can't compare all
// types.
bool Found = ParentStack.back().getMemoizationData() &&
std::find(Vector->begin(), Vector->end(),
ParentStack.back()) != Vector->end();
llvm::is_contained(*Vector, ParentStack.back());
if (!Found)
Vector->push_back(ParentStack.back());
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/RecordLayoutBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ EmptySubobjectMap::CanPlaceSubobjectAtOffset(const CXXRecordDecl *RD,
return true;

const ClassVectorTy &Classes = I->second;
if (llvm::find(Classes, RD) == Classes.end())
if (!llvm::is_contained(Classes, RD))
return true;

// There is already an empty class of the same type at this offset.
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,7 @@ bool RecordType::hasConstFields() const {
return true;
FieldTy = FieldTy.getCanonicalType();
if (const auto *FieldRecTy = FieldTy->getAs<RecordType>()) {
if (llvm::find(RecordTypeList, FieldRecTy) == RecordTypeList.end())
if (!llvm::is_contained(RecordTypeList, FieldRecTy))
RecordTypeList.push_back(FieldRecTy);
}
}
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/AST/VTableBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ void ItaniumVTableBuilder::AddThunk(const CXXMethodDecl *MD,
SmallVectorImpl<ThunkInfo> &ThunksVector = Thunks[MD];

// Check if we have this thunk already.
if (llvm::find(ThunksVector, Thunk) != ThunksVector.end())
if (llvm::is_contained(ThunksVector, Thunk))
return;

ThunksVector.push_back(Thunk);
Expand Down Expand Up @@ -2498,7 +2498,7 @@ class VFTableBuilder {
SmallVector<ThunkInfo, 1> &ThunksVector = Thunks[MD];

// Check if we have this thunk already.
if (llvm::find(ThunksVector, Thunk) != ThunksVector.end())
if (llvm::is_contained(ThunksVector, Thunk))
return;

ThunksVector.push_back(Thunk);
Expand Down
Loading