From 14b0eac48e69f7bea5815c1614310497fdc49c30 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 19 Nov 2014 02:56:13 +0000 Subject: [PATCH] Update for LLVM API change git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222303 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Frontend/Utils.h | 2 +- lib/Basic/VirtualFileSystem.cpp | 2 +- lib/CodeGen/MicrosoftCXXABI.cpp | 2 +- lib/Driver/Driver.cpp | 2 +- lib/Frontend/DependencyFile.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index ce1c9834c5..4cd93b994f 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -125,7 +125,7 @@ class ModuleDependencyCollector { public: StringRef getDest() { return DestDir; } - bool insertSeen(StringRef Filename) { return Seen.insert(Filename); } + bool insertSeen(StringRef Filename) { return Seen.insert(Filename).second; } void setHasErrors() { HasErrors = true; } void addFileMapping(StringRef VPath, StringRef RPath) { VFSWriter.addFileMapping(VPath, RPath); diff --git a/lib/Basic/VirtualFileSystem.cpp b/lib/Basic/VirtualFileSystem.cpp index 8dc7006f2d..617b82e089 100644 --- a/lib/Basic/VirtualFileSystem.cpp +++ b/lib/Basic/VirtualFileSystem.cpp @@ -296,7 +296,7 @@ class OverlayFSDirIterImpl : public clang::vfs::detail::DirIterImpl { } CurrentEntry = *CurrentDirIter; StringRef Name = llvm::sys::path::filename(CurrentEntry.getName()); - if (SeenNames.insert(Name)) + if (SeenNames.insert(Name).second) return EC; // name not seen before } llvm_unreachable("returned above"); diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index 6da8d8c8a5..a9d35c32cb 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1304,7 +1304,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD, for (size_t J = 0, F = VFPtrs.size(); J != F; ++J) { SmallString<256> Name; mangleVFTableName(getMangleContext(), RD, VFPtrs[J], Name); - if (!ObservedMangledNames.insert(Name.str())) + if (!ObservedMangledNames.insert(Name.str()).second) llvm_unreachable("Already saw this mangling before?"); } #endif diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 5d25ed77b9..d459e4be12 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -884,7 +884,7 @@ void Driver::BuildUniversalActions(const ToolChain &TC, } A->claim(); - if (ArchNames.insert(A->getValue())) + if (ArchNames.insert(A->getValue()).second) Archs.push_back(A->getValue()); } } diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 08d66c7094..6ea8f5193e 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -109,7 +109,7 @@ struct DepCollectorASTListener : public ASTReaderListener { void DependencyCollector::maybeAddDependency(StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsMissing) { - if (Seen.insert(Filename) && + if (Seen.insert(Filename).second && sawDependency(Filename, FromModule, IsSystem, IsModuleFile, IsMissing)) Dependencies.push_back(Filename); } @@ -285,7 +285,7 @@ void DFGImpl::InclusionDirective(SourceLocation HashLoc, } void DFGImpl::AddFilename(StringRef Filename) { - if (FilesSet.insert(Filename)) + if (FilesSet.insert(Filename).second) Files.push_back(Filename); } -- 2.40.0