diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-06-09 00:30:45 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-06-09 00:30:45 +0000 |
| commit | 7c89d046ea6e3d4c2042710bddcdc9452a6ec0c0 (patch) | |
| tree | b66f1d343b195e0a0d610c5dba2a23d3a56753c7 /clang | |
| parent | 643600566dcecfd9095d868c0f2aa030828faf7c (diff) | |
| download | bcm5719-llvm-7c89d046ea6e3d4c2042710bddcdc9452a6ec0c0.tar.gz bcm5719-llvm-7c89d046ea6e3d4c2042710bddcdc9452a6ec0c0.zip | |
Use SmallPtrSet instead of SmallSet in places where we iterate over the set.
SmallSet forwards to SmallPtrSet for pointer types. SmallPtrSet supports iteration, but a normal SmallSet doesn't. So if it wasn't for the forwarding, this wouldn't work.
These places were found by hiding the begin/end methods in the SmallSet forwarding.
llvm-svn: 334339
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index f9855f03a48..4125d507a1e 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -1293,7 +1293,7 @@ void clang::EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, // Save llvm.compiler.used and remote it. SmallVector<Constant*, 2> UsedArray; - SmallSet<GlobalValue*, 4> UsedGlobals; + SmallPtrSet<GlobalValue*, 4> UsedGlobals; Type *UsedElementType = Type::getInt8Ty(M->getContext())->getPointerTo(0); GlobalVariable *Used = collectUsedGlobalVariables(*M, UsedGlobals, true); for (auto *GV : UsedGlobals) { diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 8dbf5e7ac14..55517fc3f66 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -15054,9 +15054,9 @@ void Sema::SetIvarInitializers(ObjCImplementationDecl *ObjCImplementation) { static void DelegatingCycleHelper(CXXConstructorDecl* Ctor, - llvm::SmallSet<CXXConstructorDecl*, 4> &Valid, - llvm::SmallSet<CXXConstructorDecl*, 4> &Invalid, - llvm::SmallSet<CXXConstructorDecl*, 4> &Current, + llvm::SmallPtrSet<CXXConstructorDecl*, 4> &Valid, + llvm::SmallPtrSet<CXXConstructorDecl*, 4> &Invalid, + llvm::SmallPtrSet<CXXConstructorDecl*, 4> &Current, Sema &S) { if (Ctor->isInvalidDecl()) return; @@ -15118,7 +15118,7 @@ void DelegatingCycleHelper(CXXConstructorDecl* Ctor, void Sema::CheckDelegatingCtorCycles() { - llvm::SmallSet<CXXConstructorDecl*, 4> Valid, Invalid, Current; + llvm::SmallPtrSet<CXXConstructorDecl*, 4> Valid, Invalid, Current; for (DelegatingCtorDeclsType::iterator I = DelegatingCtorDecls.begin(ExternalSource), @@ -15126,9 +15126,7 @@ void Sema::CheckDelegatingCtorCycles() { I != E; ++I) DelegatingCycleHelper(*I, Valid, Invalid, Current, *this); - for (llvm::SmallSet<CXXConstructorDecl *, 4>::iterator CI = Invalid.begin(), - CE = Invalid.end(); - CI != CE; ++CI) + for (auto CI = Invalid.begin(), CE = Invalid.end(); CI != CE; ++CI) (*CI)->setInvalidDecl(); } |

