diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 368301e963..8cbb1724bf 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -557,16 +557,16 @@ bool CursorVisitor::VisitBlockDecl(BlockDecl *B) { return false; } -llvm::Optional CursorVisitor::shouldVisitCursor(CXCursor Cursor) { +Optional CursorVisitor::shouldVisitCursor(CXCursor Cursor) { if (RegionOfInterest.isValid()) { SourceRange Range = getFullCursorExtent(Cursor, AU->getSourceManager()); if (Range.isInvalid()) - return llvm::Optional(); + return Optional(); switch (CompareRegionOfInterest(Range)) { case RangeBefore: // This declaration comes before the region of interest; skip it. - return llvm::Optional(); + return Optional(); case RangeAfter: // This declaration comes after the region of interest; we're done. @@ -617,7 +617,7 @@ bool CursorVisitor::VisitDeclContext(DeclContext *DC) { Cursor = MakeCursorObjCProtocolRef(PD, PD->getLocation(), TU); } - const llvm::Optional &V = shouldVisitCursor(Cursor); + const Optional &V = shouldVisitCursor(Cursor); if (!V.hasValue()) continue; if (!V.getValue()) @@ -981,7 +981,7 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) { for (SmallVectorImpl::iterator I = DeclsInContainer.begin(), E = DeclsInContainer.end(); I != E; ++I) { CXCursor Cursor = MakeCXCursor(*I, TU, RegionOfInterest); - const llvm::Optional &V = shouldVisitCursor(Cursor); + const Optional &V = shouldVisitCursor(Cursor); if (!V.hasValue()) continue; if (!V.getValue()) @@ -5741,12 +5741,12 @@ static CXVersion convertVersion(VersionTuple In) { Out.Major = In.getMajor(); - if (llvm::Optional Minor = In.getMinor()) + if (Optional Minor = In.getMinor()) Out.Minor = *Minor; else return Out; - if (llvm::Optional Subminor = In.getSubminor()) + if (Optional Subminor = In.getSubminor()) Out.Subminor = *Subminor; return Out; diff --git a/tools/libclang/CursorVisitor.h b/tools/libclang/CursorVisitor.h index 51cb272650..38b7f334ad 100644 --- a/tools/libclang/CursorVisitor.h +++ b/tools/libclang/CursorVisitor.h @@ -199,7 +199,7 @@ public: bool VisitAttributes(Decl *D); bool VisitBlockDecl(BlockDecl *B); bool VisitCXXRecordDecl(CXXRecordDecl *D); - llvm::Optional shouldVisitCursor(CXCursor C); + Optional shouldVisitCursor(CXCursor C); bool VisitDeclContext(DeclContext *DC); bool VisitTranslationUnitDecl(TranslationUnitDecl *D); bool VisitTypedefDecl(TypedefDecl *D); diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 448fb7013f..291eb75409 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -291,7 +291,7 @@ typedef llvm::PointerUnion VecOrSet; namespace { class InferPedantic { typedef llvm::DenseMap > > GMap; + std::pair > > GMap; DiagGroupParentMap &DiagGroupParents; const std::vector &Diags;