diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 8de626e1741..5549239a8f7 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1433,7 +1433,7 @@ namespace { struct CaptureFinder : ConstStmtVisitor<CaptureFinder> { CodeGenFunction &ParentCGF; const VarDecl *ParentThis; - SmallVector<const VarDecl *, 4> Captures; + llvm::SmallSetVector<const VarDecl *, 4> Captures; Address SEHCodeSlot = Address::invalid(); CaptureFinder(CodeGenFunction &ParentCGF, const VarDecl *ParentThis) : ParentCGF(ParentCGF), ParentThis(ParentThis) {} @@ -1454,17 +1454,17 @@ struct CaptureFinder : ConstStmtVisitor<CaptureFinder> { void VisitDeclRefExpr(const DeclRefExpr *E) { // If this is already a capture, just make sure we capture 'this'. if (E->refersToEnclosingVariableOrCapture()) { - Captures.push_back(ParentThis); + Captures.insert(ParentThis); return; } const auto *D = dyn_cast<VarDecl>(E->getDecl()); if (D && D->isLocalVarDeclOrParm() && D->hasLocalStorage()) - Captures.push_back(D); + Captures.insert(D); } void VisitCXXThisExpr(const CXXThisExpr *E) { - Captures.push_back(ParentThis); + Captures.insert(ParentThis); } void VisitCallExpr(const CallExpr *E) { |