forked from OSchip/llvm-project
Clearing a SmallPtrSet is still expensive, split it out from OverloadCandidateSet::clear and don't do it on destruction.
llvm-svn: 165501
This commit is contained in:
parent
2747e22051
commit
97e5949068
|
@ -751,9 +751,11 @@ namespace clang {
|
|||
OverloadCandidateSet(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
|
||||
void operator=(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
|
||||
|
||||
void destroyCandidates();
|
||||
|
||||
public:
|
||||
OverloadCandidateSet(SourceLocation Loc) : Loc(Loc), NumInlineSequences(0){}
|
||||
~OverloadCandidateSet() { clear(); }
|
||||
~OverloadCandidateSet() { destroyCandidates(); }
|
||||
|
||||
SourceLocation getLocation() const { return Loc; }
|
||||
|
||||
|
|
|
@ -740,13 +740,17 @@ OverloadCandidate::DeductionFailureInfo::getSecondArg() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void OverloadCandidateSet::clear() {
|
||||
void OverloadCandidateSet::destroyCandidates() {
|
||||
for (iterator i = begin(), e = end(); i != e; ++i) {
|
||||
for (unsigned ii = 0, ie = i->NumConversions; ii != ie; ++ii)
|
||||
i->Conversions[ii].~ImplicitConversionSequence();
|
||||
if (!i->Viable && i->FailureKind == ovl_fail_bad_deduction)
|
||||
i->DeductionFailure.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void OverloadCandidateSet::clear() {
|
||||
destroyCandidates();
|
||||
NumInlineSequences = 0;
|
||||
Candidates.clear();
|
||||
Functions.clear();
|
||||
|
|
Loading…
Reference in New Issue