From: Benjamin Kramer Date: Sun, 2 Mar 2014 13:01:17 +0000 (+0000) Subject: [C++11] Replace llvm::tie with std::tie. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba9fd9e97eb0a194186ae9fc4d3344f5c8640c09;p=clang [C++11] Replace llvm::tie with std::tie. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202639 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 261252a7dc..a53937781a 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -505,7 +505,7 @@ struct SplitQualType { SplitQualType getSingleStepDesugaredType() const; // end of this file - // Make llvm::tie work. + // Make std::tie work. operator std::pair() const { return std::pair(Ty, Quals); } diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index a8010e1ab5..a527e0c252 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -1666,7 +1666,7 @@ private: void writeLoc(SourceLocation Loc) { FileID FID; unsigned Offset; - llvm::tie(FID, Offset) = SourceMgr.getDecomposedLoc(Loc); + std::tie(FID, Offset) = SourceMgr.getDecomposedLoc(Loc); assert(!FID.isInvalid()); SmallString<200> Path = StringRef(SourceMgr.getFileEntryForID(FID)->getName()); diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index 446a284a28..61e2e98513 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -212,7 +212,7 @@ private: return false; Stmt *prevStmt, *nextStmt; - llvm::tie(prevStmt, nextStmt) = getPreviousAndNextStmt(E); + std::tie(prevStmt, nextStmt) = getPreviousAndNextStmt(E); return isPlusOneAssignToVar(prevStmt, RefD) || isPlusOneAssignToVar(nextStmt, RefD); diff --git a/lib/ARCMigrate/TransUnbridgedCasts.cpp b/lib/ARCMigrate/TransUnbridgedCasts.cpp index 76973dceca..8c621280ab 100644 --- a/lib/ARCMigrate/TransUnbridgedCasts.cpp +++ b/lib/ARCMigrate/TransUnbridgedCasts.cpp @@ -283,7 +283,7 @@ private: SourceLocation Loc = E->getExprLoc(); assert(Loc.isMacroID()); SourceLocation MacroBegin, MacroEnd; - llvm::tie(MacroBegin, MacroEnd) = SM.getImmediateExpansionRange(Loc); + std::tie(MacroBegin, MacroEnd) = SM.getImmediateExpansionRange(Loc); SourceRange SubRange = E->getSubExpr()->IgnoreParenImpCasts()->getSourceRange(); SourceLocation InnerBegin = SM.getImmediateMacroCallerLoc(SubRange.getBegin()); SourceLocation InnerEnd = SM.getImmediateMacroCallerLoc(SubRange.getEnd()); diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 65bb024b2a..545228a178 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1617,7 +1617,7 @@ ASTContext::getTypeInfoImpl(const Type *T) const { } case Type::MemberPointer: { const MemberPointerType *MPT = cast(T); - llvm::tie(Width, Align) = ABI->getMemberPointerWidthAndAlign(MPT); + std::tie(Width, Align) = ABI->getMemberPointerWidthAndAlign(MPT); break; } case Type::Complex: { diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index ee9f07278f..e362c730d4 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -3429,7 +3429,7 @@ void RecordDecl::LoadFieldsFromExternalStorage() const { if (Decls.empty()) return; - llvm::tie(FirstDecl, LastDecl) = BuildDeclChain(Decls, + std::tie(FirstDecl, LastDecl) = BuildDeclChain(Decls, /*FieldsAlreadyLoaded=*/false); } diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 288d66a205..6c9d5ca76c 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -1008,8 +1008,8 @@ DeclContext::LoadLexicalDeclsFromExternalStorage() const { // Splice the newly-read declarations into the beginning of the list // of declarations. Decl *ExternalFirst, *ExternalLast; - llvm::tie(ExternalFirst, ExternalLast) = BuildDeclChain(Decls, - FieldsAlreadyLoaded); + std::tie(ExternalFirst, ExternalLast) = + BuildDeclChain(Decls, FieldsAlreadyLoaded); ExternalLast->NextInContextAndBits.setPointer(FirstDecl); FirstDecl = ExternalFirst; if (!LastDecl) diff --git a/lib/AST/MicrosoftCXXABI.cpp b/lib/AST/MicrosoftCXXABI.cpp index f8e03aed20..6d015c3b47 100644 --- a/lib/AST/MicrosoftCXXABI.cpp +++ b/lib/AST/MicrosoftCXXABI.cpp @@ -169,7 +169,7 @@ std::pair MicrosoftCXXABI::getMemberPointerWidthAndAlign( assert(Target.getTriple().getArch() == llvm::Triple::x86 || Target.getTriple().getArch() == llvm::Triple::x86_64); unsigned Ptrs, Ints; - llvm::tie(Ptrs, Ints) = getMSMemberPointerSlots(MPT); + std::tie(Ptrs, Ints) = getMSMemberPointerSlots(MPT); // The nominal struct is laid out with pointers followed by ints and aligned // to a pointer width if any are present and an int width otherwise. unsigned PtrSize = Target.getPointerWidth(0); diff --git a/lib/AST/RawCommentList.cpp b/lib/AST/RawCommentList.cpp index 1fa7cea1d4..586c076542 100644 --- a/lib/AST/RawCommentList.cpp +++ b/lib/AST/RawCommentList.cpp @@ -95,10 +95,9 @@ StringRef RawComment::getRawTextSlow(const SourceManager &SourceMgr) const { unsigned BeginOffset; unsigned EndOffset; - llvm::tie(BeginFileID, BeginOffset) = + std::tie(BeginFileID, BeginOffset) = SourceMgr.getDecomposedLoc(Range.getBegin()); - llvm::tie(EndFileID, EndOffset) = - SourceMgr.getDecomposedLoc(Range.getEnd()); + std::tie(EndFileID, EndOffset) = SourceMgr.getDecomposedLoc(Range.getEnd()); const unsigned Length = EndOffset - BeginOffset; if (Length < 2) diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 1e081d212d..bd58d32d90 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -2265,7 +2265,7 @@ MicrosoftRecordLayoutBuilder::ElementInfo MicrosoftRecordLayoutBuilder::getAdjustedElementInfo( const FieldDecl *FD) { ElementInfo Info; - llvm::tie(Info.Size, Info.Alignment) = + std::tie(Info.Size, Info.Alignment) = Context.getTypeInfoInChars(FD->getType()); // Respect align attributes. CharUnits FieldRequiredAlignment = diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index 99395b9189..741be14da6 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2823,7 +2823,7 @@ static void GroupNewVirtualOverloads( VisitedGroupIndicesTy::iterator J; bool Inserted; - llvm::tie(J, Inserted) = VisitedGroupIndices.insert( + std::tie(J, Inserted) = VisitedGroupIndices.insert( std::make_pair(MD->getDeclName(), Groups.size())); if (Inserted) Groups.push_back(MethodGroup()); diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index c28513324b..a4991f6b74 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -1308,7 +1308,7 @@ CFGBuilder::VisitLogicalOperator(BinaryOperator *B, do { if (BinaryOperator *B_RHS = dyn_cast(RHS)) if (B_RHS->isLogicalOp()) { - llvm::tie(RHSBlock, ExitBlock) = + std::tie(RHSBlock, ExitBlock) = VisitLogicalOperator(B_RHS, Term, TrueBlock, FalseBlock); break; } @@ -2094,7 +2094,7 @@ CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) { if (BinaryOperator *Cond = dyn_cast_or_null(C ? C->IgnoreParens() : 0)) if (Cond->isLogicalOp()) { - llvm::tie(EntryConditionBlock, ExitConditionBlock) = + std::tie(EntryConditionBlock, ExitConditionBlock) = VisitLogicalOperator(Cond, F, BodyBlock, LoopSuccessor); break; } @@ -2410,9 +2410,8 @@ CFGBlock *CFGBuilder::VisitWhileStmt(WhileStmt *W) { // more optimal CFG representation. if (BinaryOperator *Cond = dyn_cast(C->IgnoreParens())) if (Cond->isLogicalOp()) { - llvm::tie(EntryConditionBlock, ExitConditionBlock) = - VisitLogicalOperator(Cond, W, BodyBlock, - LoopSuccessor); + std::tie(EntryConditionBlock, ExitConditionBlock) = + VisitLogicalOperator(Cond, W, BodyBlock, LoopSuccessor); break; } diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 9e5ec557bc..f13f90324c 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -372,7 +372,7 @@ void TransferFunctions::VisitBinaryOperator(BinaryOperator *B) { void TransferFunctions::VisitBlockExpr(BlockExpr *BE) { AnalysisDeclContext::referenced_decls_iterator I, E; - llvm::tie(I, E) = + std::tie(I, E) = LV.analysisContext.getReferencedBlockVars(BE->getBlockDecl()); for ( ; I != E ; ++I) { const VarDecl *VD = *I; diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index bc31189d1f..bc42d3e92d 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -1890,7 +1890,7 @@ void SourceManager::associateFileChunkWithMacroArgExp( FileID SpellFID; // Current FileID in the spelling range. unsigned SpellRelativeOffs; - llvm::tie(SpellFID, SpellRelativeOffs) = getDecomposedLoc(SpellLoc); + std::tie(SpellFID, SpellRelativeOffs) = getDecomposedLoc(SpellLoc); while (1) { const SLocEntry &Entry = getSLocEntry(SpellFID); unsigned SpellFIDBeginOffs = Entry.getOffset(); @@ -1969,7 +1969,7 @@ SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { FileID FID; unsigned Offset; - llvm::tie(FID, Offset) = getDecomposedLoc(Loc); + std::tie(FID, Offset) = getDecomposedLoc(Loc); if (FID.isInvalid()) return Loc; diff --git a/lib/CodeGen/CGAtomic.cpp b/lib/CodeGen/CGAtomic.cpp index 0df2a4000e..cb92f9ad22 100644 --- a/lib/CodeGen/CGAtomic.cpp +++ b/lib/CodeGen/CGAtomic.cpp @@ -57,10 +57,10 @@ namespace { ASTContext &C = CGF.getContext(); uint64_t valueAlignInBits; - llvm::tie(ValueSizeInBits, valueAlignInBits) = C.getTypeInfo(ValueTy); + std::tie(ValueSizeInBits, valueAlignInBits) = C.getTypeInfo(ValueTy); uint64_t atomicAlignInBits; - llvm::tie(AtomicSizeInBits, atomicAlignInBits) = C.getTypeInfo(AtomicTy); + std::tie(AtomicSizeInBits, atomicAlignInBits) = C.getTypeInfo(AtomicTy); assert(ValueSizeInBits <= AtomicSizeInBits); assert(valueAlignInBits <= atomicAlignInBits); diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 7282815247..a22fc3f03a 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -300,8 +300,8 @@ static void initializeForBlockHeader(CodeGenModule &CGM, CGBlockInfo &info, // The header is basically a 'struct { void *; int; int; void *; void *; }'. CharUnits ptrSize, ptrAlign, intSize, intAlign; - llvm::tie(ptrSize, ptrAlign) = C.getTypeInfoInChars(C.VoidPtrTy); - llvm::tie(intSize, intAlign) = C.getTypeInfoInChars(C.IntTy); + std::tie(ptrSize, ptrAlign) = C.getTypeInfoInChars(C.VoidPtrTy); + std::tie(intSize, intAlign) = C.getTypeInfoInChars(C.IntTy); // Are there crazy embedded platforms where this isn't true? assert(intSize <= ptrSize && "layout assumptions horribly violated"); diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index b9f7124ee2..d7321791d8 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -793,7 +793,7 @@ llvm::DIType CGDebugInfo::createFieldType(StringRef name, uint64_t sizeInBits = 0; unsigned alignInBits = 0; if (!type->isIncompleteArrayType()) { - llvm::tie(sizeInBits, alignInBits) = CGM.getContext().getTypeInfo(type); + std::tie(sizeInBits, alignInBits) = CGM.getContext().getTypeInfo(type); if (sizeInBitsOverride) sizeInBits = sizeInBitsOverride; diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index cb48e84aac..8ce03030b8 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -949,7 +949,7 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { llvm::Value *elementCount; QualType elementType; - llvm::tie(elementCount, elementType) = getVLASize(Ty); + std::tie(elementCount, elementType) = getVLASize(Ty); llvm::Type *llvmTy = ConvertTypeForMem(elementType); diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 653b5a2bd4..f24c20ca42 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1914,7 +1914,7 @@ ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( QualType eltType; llvm::Value *numElts; - llvm::tie(numElts, eltType) = CGF.getVLASize(VAT); + std::tie(numElts, eltType) = CGF.getVLASize(VAT); llvm::Value *size = numElts; @@ -2537,7 +2537,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &op) { if (const VariableArrayType *vla = CGF.getContext().getAsVariableArrayType(elementType)) { llvm::Value *numElements; - llvm::tie(numElements, elementType) = CGF.getVLASize(vla); + std::tie(numElements, elementType) = CGF.getVLASize(vla); divisor = numElements; @@ -2826,11 +2826,11 @@ Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) { switch (E->getLHS()->getType().getObjCLifetime()) { case Qualifiers::OCL_Strong: - llvm::tie(LHS, RHS) = CGF.EmitARCStoreStrong(E, Ignore); + std::tie(LHS, RHS) = CGF.EmitARCStoreStrong(E, Ignore); break; case Qualifiers::OCL_Autoreleasing: - llvm::tie(LHS,RHS) = CGF.EmitARCStoreAutoreleasing(E); + std::tie(LHS, RHS) = CGF.EmitARCStoreAutoreleasing(E); break; case Qualifiers::OCL_Weak: diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index dcc1074b7d..a50c0b8cdc 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -619,8 +619,8 @@ PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM, // Evaluate the ivar's size and alignment. ObjCIvarDecl *ivar = propImpl->getPropertyIvarDecl(); QualType ivarType = ivar->getType(); - llvm::tie(IvarSize, IvarAlignment) - = CGM.getContext().getTypeInfoInChars(ivarType); + std::tie(IvarSize, IvarAlignment) = + CGM.getContext().getTypeInfoInChars(ivarType); // If we have a copy property, we always have to use getProperty/setProperty. // TODO: we could actually use setProperty and an expression for non-atomics. diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index ec04fa261f..c550aaded7 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -1186,7 +1186,7 @@ CodeGenFunction::EmitNullInitialization(llvm::Value *DestPtr, QualType Ty) { getContext().getAsArrayType(Ty))) { QualType eltType; llvm::Value *numElts; - llvm::tie(numElts, eltType) = getVLASize(vlaType); + std::tie(numElts, eltType) = getVLASize(vlaType); SizeVal = numElts; CharUnits eltSize = getContext().getTypeSizeInChars(eltType); diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index 804d4cdd2d..12b743ab00 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -898,7 +898,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD, VFTableIdTy ID(RD, VPtrOffset); VFTablesMapTy::iterator I; bool Inserted; - llvm::tie(I, Inserted) = VFTablesMap.insert( + std::tie(I, Inserted) = VFTablesMap.insert( std::make_pair(ID, static_cast(0))); if (!Inserted) return I->second; @@ -995,7 +995,8 @@ MicrosoftCXXABI::enumerateVBTables(const CXXRecordDecl *RD) { // easier than caching each vbtable individually. llvm::DenseMap::iterator Entry; bool Added; - llvm::tie(Entry, Added) = VBTablesMap.insert(std::make_pair(RD, VBTableGlobals())); + std::tie(Entry, Added) = + VBTablesMap.insert(std::make_pair(RD, VBTableGlobals())); VBTableGlobals &VBGlobals = Entry->second; if (!Added) return VBGlobals; diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 8d1b4015f7..ba53db073c 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -109,7 +109,7 @@ InputArgList *Driver::ParseArgStrings(ArrayRef ArgList) { unsigned IncludedFlagsBitmask; unsigned ExcludedFlagsBitmask; - llvm::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) = + std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) = getIncludeExcludeOptionFlagMasks(); unsigned MissingArgIndex, MissingArgCount; @@ -619,7 +619,7 @@ int Driver::ExecuteCompilation(const Compilation &C, void Driver::PrintHelp(bool ShowHidden) const { unsigned IncludedFlagsBitmask; unsigned ExcludedFlagsBitmask; - llvm::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) = + std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) = getIncludeExcludeOptionFlagMasks(); ExcludedFlagsBitmask |= options::NoDriverOption; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 165af301bc..9d7e533c06 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -475,7 +475,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) { StringRef first, second; StringRef isysroot = A->getValue(); - llvm::tie(first, second) = isysroot.split(StringRef("SDKs/iPhoneOS")); + std::tie(first, second) = isysroot.split(StringRef("SDKs/iPhoneOS")); if (second != "") iOSTarget = second.substr(0,3); } diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index a78ea769d2..913bbc77dd 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -2673,7 +2673,7 @@ void ASTUnit::addFileLevelDecl(Decl *D) { assert(SM.isLocalSourceLocation(FileLoc)); FileID FID; unsigned Offset; - llvm::tie(FID, Offset) = SM.getDecomposedLoc(FileLoc); + std::tie(FID, Offset) = SM.getDecomposedLoc(FileLoc); if (FID.isInvalid()) return; @@ -2856,7 +2856,7 @@ bool ASTUnit::visitLocalTopLevelDecls(void *context, DeclVisitorFn Fn) { serialization::ModuleFile & Mod = Reader->getModuleManager().getPrimaryModule(); ASTReader::ModuleDeclIterator MDI, MDE; - llvm::tie(MDI, MDE) = Reader->getModuleFileLevelDecls(Mod); + std::tie(MDI, MDE) = Reader->getModuleFileLevelDecls(Mod); for (; MDI != MDE; ++MDI) { if (!Fn(context, *MDI)) return false; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index ad2d37cc29..c2571d716a 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -263,7 +263,7 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, configList.split(configVals, ","); for (unsigned i = 0, e = configVals.size(); i != e; ++i) { StringRef key, val; - llvm::tie(key, val) = configVals[i].split("="); + std::tie(key, val) = configVals[i].split("="); if (val.empty()) { Diags.Report(SourceLocation(), diag::err_analyzer_config_no_value) << configVals[i]; diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 2adc51e109..0955cc5b33 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -861,7 +861,7 @@ static CharSourceRange makeRangeFromFileLocs(CharSourceRange Range, // Break down the source locations. FileID FID; unsigned BeginOffs; - llvm::tie(FID, BeginOffs) = SM.getDecomposedLoc(Begin); + std::tie(FID, BeginOffs) = SM.getDecomposedLoc(Begin); if (FID.isInvalid()) return CharSourceRange(); diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 84f1ea5b1f..55b3bd5b89 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -796,7 +796,7 @@ Token *Preprocessor::cacheMacroExpandedTokens(TokenLexer *tokLexer, for (unsigned i = 0, e = MacroExpandingLexersStack.size(); i != e; ++i) { TokenLexer *prevLexer; size_t tokIndex; - llvm::tie(prevLexer, tokIndex) = MacroExpandingLexersStack[i]; + std::tie(prevLexer, tokIndex) = MacroExpandingLexersStack[i]; prevLexer->Tokens = MacroExpandedTokens.data() + tokIndex; } } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 6de3c6ee5c..97101f464b 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -6004,8 +6004,8 @@ checkPointerTypesForAssignment(Sema &S, QualType LHSType, QualType RHSType) { // get the "pointed to" type (ignoring qualifiers at the top level) const Type *lhptee, *rhptee; Qualifiers lhq, rhq; - llvm::tie(lhptee, lhq) = cast(LHSType)->getPointeeType().split(); - llvm::tie(rhptee, rhq) = cast(RHSType)->getPointeeType().split(); + std::tie(lhptee, lhq) = cast(LHSType)->getPointeeType().split(); + std::tie(rhptee, rhq) = cast(RHSType)->getPointeeType().split(); Sema::AssignConvertType ConvTy = Sema::Compatible; diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index f975aa0a7b..dfd078f5de 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -154,7 +154,7 @@ namespace { SmallVector queue; while (true) { DeclContext::udir_iterator I, End; - for (llvm::tie(I, End) = DC->getUsingDirectives(); I != End; ++I) { + for (std::tie(I, End) = DC->getUsingDirectives(); I != End; ++I) { UsingDirectiveDecl *UD = *I; DeclContext *NS = UD->getNominatedNamespace(); if (visited.insert(NS)) { @@ -768,7 +768,7 @@ CppNamespaceLookup(Sema &S, LookupResult &R, ASTContext &Context, // Perform direct name lookup into the namespaces nominated by the // using directives whose common ancestor is this namespace. UnqualUsingDirectiveSet::const_iterator UI, UEnd; - llvm::tie(UI, UEnd) = UDirs.getNamespacesFor(NS); + std::tie(UI, UEnd) = UDirs.getNamespacesFor(NS); for (; UI != UEnd; ++UI) if (LookupDirect(S, R, UI->getNominatedNamespace())) @@ -980,7 +980,7 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) { if (Ctx) { DeclContext *OuterCtx; bool SearchAfterTemplateScope; - llvm::tie(OuterCtx, SearchAfterTemplateScope) = findOuterContext(S); + std::tie(OuterCtx, SearchAfterTemplateScope) = findOuterContext(S); if (SearchAfterTemplateScope) OutsideOfTemplateParamDC = OuterCtx; @@ -1123,7 +1123,7 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) { if (Ctx) { DeclContext *OuterCtx; bool SearchAfterTemplateScope; - llvm::tie(OuterCtx, SearchAfterTemplateScope) = findOuterContext(S); + std::tie(OuterCtx, SearchAfterTemplateScope) = findOuterContext(S); if (SearchAfterTemplateScope) OutsideOfTemplateParamDC = OuterCtx; @@ -1516,7 +1516,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, continue; } - for (llvm::tie(I,E) = ND->getUsingDirectives(); I != E; ++I) { + for (std::tie(I, E) = ND->getUsingDirectives(); I != E; ++I) { NamespaceDecl *Nom = (*I)->getNominatedNamespace(); if (Visited.insert(Nom)) Queue.push_back(Nom); @@ -3087,7 +3087,7 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, if (QualifiedNameLookup) { ShadowContextRAII Shadow(Visited); DeclContext::udir_iterator I, E; - for (llvm::tie(I, E) = Ctx->getUsingDirectives(); I != E; ++I) { + for (std::tie(I, E) = Ctx->getUsingDirectives(); I != E; ++I) { LookupVisibleDecls((*I)->getNominatedNamespace(), Result, QualifiedNameLookup, InBaseClass, Consumer, Visited); } @@ -3273,7 +3273,7 @@ static void LookupVisibleDecls(Scope *S, LookupResult &Result, // Lookup visible declarations in any namespaces found by using // directives. UnqualUsingDirectiveSet::const_iterator UI, UEnd; - llvm::tie(UI, UEnd) = UDirs.getNamespacesFor(Entity); + std::tie(UI, UEnd) = UDirs.getNamespacesFor(Entity); for (; UI != UEnd; ++UI) LookupVisibleDecls(const_cast(UI->getNominatedNamespace()), Result, /*QualifiedNameLookup=*/false, diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 94ef7f46fd..75324c617e 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -783,7 +783,7 @@ DeduceTemplateArguments(Sema &S, S.collectUnexpandedParameterPacks(Pattern, Unexpanded); for (unsigned I = 0, N = Unexpanded.size(); I != N; ++I) { unsigned Depth, Index; - llvm::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); + std::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); if (Depth == 0 && !SawIndices[Index]) { SawIndices[Index] = true; PackIndices.push_back(Index); @@ -1863,7 +1863,7 @@ DeduceTemplateArguments(Sema &S, S.collectUnexpandedParameterPacks(Pattern, Unexpanded); for (unsigned I = 0, N = Unexpanded.size(); I != N; ++I) { unsigned Depth, Index; - llvm::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); + std::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); if (Depth == 0 && !SawIndices[Index]) { SawIndices[Index] = true; PackIndices.push_back(Index); @@ -3415,7 +3415,7 @@ Sema::TemplateDeductionResult Sema::DeduceTemplateArguments( collectUnexpandedParameterPacks(ParamPattern, Unexpanded); for (unsigned I = 0, N = Unexpanded.size(); I != N; ++I) { unsigned Depth, Index; - llvm::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); + std::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); if (Depth == 0 && !SawIndices[Index]) { SawIndices[Index] = true; PackIndices.push_back(Index); diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index efd53cff18..20f3a1adb6 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -799,7 +799,7 @@ namespace { MultiLevelTemplateArgumentList &TemplateArgs = const_cast(this->TemplateArgs); unsigned Depth, Index; - llvm::tie(Depth, Index) = getDepthAndIndex(PartialPack); + std::tie(Depth, Index) = getDepthAndIndex(PartialPack); if (TemplateArgs.hasTemplateArgument(Depth, Index)) { Result = TemplateArgs(Depth, Index); TemplateArgs.setArgument(Depth, Index, TemplateArgument()); @@ -818,7 +818,7 @@ namespace { MultiLevelTemplateArgumentList &TemplateArgs = const_cast(this->TemplateArgs); unsigned Depth, Index; - llvm::tie(Depth, Index) = getDepthAndIndex(PartialPack); + std::tie(Depth, Index) = getDepthAndIndex(PartialPack); TemplateArgs.setArgument(Depth, Index, Arg); } } diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp index 878970a323..f2b57dcc13 100644 --- a/lib/Sema/SemaTemplateVariadic.cpp +++ b/lib/Sema/SemaTemplateVariadic.cpp @@ -554,8 +554,8 @@ bool Sema::CheckParameterPacksForExpansion( if (isa(ND)) IsFunctionParameterPack = true; else - llvm::tie(Depth, Index) = getDepthAndIndex(ND); - + std::tie(Depth, Index) = getDepthAndIndex(ND); + Name = ND->getIdentifier(); } @@ -599,7 +599,7 @@ bool Sema::CheckParameterPacksForExpansion( if (NamedDecl *PartialPack = CurrentInstantiationScope->getPartiallySubstitutedPack()){ unsigned PartialDepth, PartialIndex; - llvm::tie(PartialDepth, PartialIndex) = getDepthAndIndex(PartialPack); + std::tie(PartialDepth, PartialIndex) = getDepthAndIndex(PartialPack); if (PartialDepth == Depth && PartialIndex == Index) RetainExpansion = true; } @@ -669,8 +669,8 @@ Optional Sema::getNumArgumentsInExpansion(QualType T, Result = Size; continue; } - - llvm::tie(Depth, Index) = getDepthAndIndex(ND); + + std::tie(Depth, Index) = getDepthAndIndex(ND); } if (Depth >= TemplateArgs.getNumLevels() || !TemplateArgs.hasTemplateArgument(Depth, Index)) diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index c0da65d583..458d9ec95c 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -2571,7 +2571,7 @@ bool ASTReader::ReadASTBlock(ModuleFile &F) { F.SLocEntryOffsets = (const uint32_t *)Blob.data(); F.LocalNumSLocEntries = Record[0]; unsigned SLocSpaceSize = Record[1]; - llvm::tie(F.SLocEntryBaseID, F.SLocEntryBaseOffset) = + std::tie(F.SLocEntryBaseID, F.SLocEntryBaseOffset) = SourceMgr.AllocateLoadedSLocEntries(F.LocalNumSLocEntries, SLocSpaceSize); // Make our entry in the range map. BaseID is negative and growing, so diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 958e18183c..b9034f951f 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -909,8 +909,8 @@ void ASTDeclReader::VisitObjCImplementationDecl(ObjCImplementationDecl *D) { D->setIvarRBraceLoc(ReadSourceLocation(Record, Idx)); D->setHasNonZeroConstructors(Record[Idx++]); D->setHasDestructors(Record[Idx++]); - llvm::tie(D->IvarInitializers, D->NumIvarInitializers) - = Reader.ReadCXXCtorInitializers(F, Record, Idx); + std::tie(D->IvarInitializers, D->NumIvarInitializers) = + Reader.ReadCXXCtorInitializers(F, Record, Idx); } @@ -1350,8 +1350,8 @@ void ASTDeclReader::VisitCXXConstructorDecl(CXXConstructorDecl *D) { VisitCXXMethodDecl(D); D->IsExplicitSpecified = Record[Idx++]; - llvm::tie(D->CtorInitializers, D->NumCtorInitializers) - = Reader.ReadCXXCtorInitializers(F, Record, Idx); + std::tie(D->CtorInitializers, D->NumCtorInitializers) = + Reader.ReadCXXCtorInitializers(F, Record, Idx); } void ASTDeclReader::VisitCXXDestructorDecl(CXXDestructorDecl *D) { diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index df73af4305..c9c339eaee 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -4682,7 +4682,7 @@ void ASTWriter::associateDeclWithFile(const Decl *D, DeclID ID) { assert(SM.isLocalSourceLocation(FileLoc)); FileID FID; unsigned Offset; - llvm::tie(FID, Offset) = SM.getDecomposedLoc(FileLoc); + std::tie(FID, Offset) = SM.getDecomposedLoc(FileLoc); if (FID.isInvalid()) return; assert(SM.getSLocEntry(FID).isFile()); diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp index e33f72efa5..936d8db466 100644 --- a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp +++ b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp @@ -120,7 +120,7 @@ void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad, return; ProgramStateRef state_precedesLowerBound, state_withinLowerBound; - llvm::tie(state_precedesLowerBound, state_withinLowerBound) = + std::tie(state_precedesLowerBound, state_withinLowerBound) = state->assume(*lowerBoundToCheck); // Are we constrained enough to definitely precede the lower bound? @@ -152,7 +152,7 @@ void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad, break; ProgramStateRef state_exceedsUpperBound, state_withinUpperBound; - llvm::tie(state_exceedsUpperBound, state_withinUpperBound) = + std::tie(state_exceedsUpperBound, state_withinUpperBound) = state->assume(*upperboundToCheck); // If we are under constrained and the index variables are tainted, report. diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index b5aa4b3d08..53e12cd393 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -552,7 +552,7 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE, // Are they equal? ProgramStateRef stateTrue, stateFalse; - llvm::tie(stateTrue, stateFalse) = state->assume(ArgIsNull); + std::tie(stateTrue, stateFalse) = state->assume(ArgIsNull); if (stateTrue && !stateFalse) { ExplodedNode *N = C.generateSink(stateTrue); @@ -858,7 +858,7 @@ static ProgramStateRef checkCollectionNonNil(CheckerContext &C, return State; ProgramStateRef StNonNil, StNil; - llvm::tie(StNonNil, StNil) = State->assume(*KnownCollection); + std::tie(StNonNil, StNil) = State->assume(*KnownCollection); if (StNil && !StNonNil) { // The collection is nil. This path is infeasible. return NULL; diff --git a/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp b/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp index 03368b63ce..7227dcf82c 100644 --- a/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp @@ -96,7 +96,7 @@ void BoolAssignmentChecker::checkBind(SVal loc, SVal val, const Stmt *S, } ProgramStateRef stateLT, stateGE; - llvm::tie(stateGE, stateLT) = CM.assumeDual(state, *greaterThanEqualToZero); + std::tie(stateGE, stateLT) = CM.assumeDual(state, *greaterThanEqualToZero); // Is it possible for the value to be less than zero? if (stateLT) { @@ -132,7 +132,7 @@ void BoolAssignmentChecker::checkBind(SVal loc, SVal val, const Stmt *S, } ProgramStateRef stateGT, stateLE; - llvm::tie(stateLE, stateGT) = CM.assumeDual(state, *lessThanEqToOne); + std::tie(stateLE, stateGT) = CM.assumeDual(state, *lessThanEqToOne); // Is it possible for the value to be greater than one? if (stateGT) { diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index 8396cc750a..3c5cf615c8 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -226,7 +226,7 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return NULL; ProgramStateRef stateNull, stateNonNull; - llvm::tie(stateNull, stateNonNull) = assumeZero(C, state, l, S->getType()); + std::tie(stateNull, stateNonNull) = assumeZero(C, state, l, S->getType()); if (stateNull && !stateNonNull) { if (!Filter.CheckCStringNullArg) @@ -446,7 +446,7 @@ ProgramStateRef CStringChecker::CheckOverlap(CheckerContext &C, // Are the two values the same? SValBuilder &svalBuilder = C.getSValBuilder(); - llvm::tie(stateTrue, stateFalse) = + std::tie(stateTrue, stateFalse) = state->assume(svalBuilder.evalEQ(state, *firstLoc, *secondLoc)); if (stateTrue && !stateFalse) { @@ -468,7 +468,7 @@ ProgramStateRef CStringChecker::CheckOverlap(CheckerContext &C, if (!reverseTest) return state; - llvm::tie(stateTrue, stateFalse) = state->assume(*reverseTest); + std::tie(stateTrue, stateFalse) = state->assume(*reverseTest); if (stateTrue) { if (stateFalse) { // If we don't know which one comes first, we can't perform this test. @@ -513,7 +513,7 @@ ProgramStateRef CStringChecker::CheckOverlap(CheckerContext &C, if (!OverlapTest) return state; - llvm::tie(stateTrue, stateFalse) = state->assume(*OverlapTest); + std::tie(stateTrue, stateFalse) = state->assume(*OverlapTest); if (stateTrue && !stateFalse) { // Overlap! @@ -584,7 +584,7 @@ ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C, *maxMinusRightNL, cmpTy); ProgramStateRef stateOverflow, stateOkay; - llvm::tie(stateOverflow, stateOkay) = + std::tie(stateOverflow, stateOkay) = state->assume(willOverflow.castAs()); if (stateOverflow && !stateOkay) { @@ -919,7 +919,7 @@ void CStringChecker::evalCopyCommon(CheckerContext &C, QualType sizeTy = Size->getType(); ProgramStateRef stateZeroSize, stateNonZeroSize; - llvm::tie(stateZeroSize, stateNonZeroSize) = + std::tie(stateZeroSize, stateNonZeroSize) = assumeZero(C, state, sizeVal, sizeTy); // Get the value of the Dest. @@ -1076,7 +1076,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) const { QualType sizeTy = Size->getType(); ProgramStateRef stateZeroSize, stateNonZeroSize; - llvm::tie(stateZeroSize, stateNonZeroSize) = + std::tie(stateZeroSize, stateNonZeroSize) = assumeZero(C, state, sizeVal, sizeTy); // If the size can be zero, the result will be 0 in that case, and we don't @@ -1102,7 +1102,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) const { // See if they are the same. DefinedOrUnknownSVal SameBuf = svalBuilder.evalEQ(state, LV, RV); ProgramStateRef StSameBuf, StNotSameBuf; - llvm::tie(StSameBuf, StNotSameBuf) = state->assume(SameBuf); + std::tie(StSameBuf, StNotSameBuf) = state->assume(SameBuf); // If the two arguments might be the same buffer, we know the result is 0, // and we only need to check one size. @@ -1160,7 +1160,7 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C, const CallExpr *CE, SVal maxlenVal = state->getSVal(maxlenExpr, LCtx); ProgramStateRef stateZeroSize, stateNonZeroSize; - llvm::tie(stateZeroSize, stateNonZeroSize) = + std::tie(stateZeroSize, stateNonZeroSize) = assumeZero(C, state, maxlenVal, maxlenExpr->getType()); // If the size can be zero, the result will be 0 in that case, and we don't @@ -1214,10 +1214,10 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C, const CallExpr *CE, ProgramStateRef stateStringTooLong, stateStringNotTooLong; // Check if the strLength is greater than the maxlen. - llvm::tie(stateStringTooLong, stateStringNotTooLong) = - state->assume(C.getSValBuilder().evalBinOpNN( - state, BO_GT, *strLengthNL, *maxlenValNL, cmpTy) - .castAs()); + std::tie(stateStringTooLong, stateStringNotTooLong) = state->assume( + C.getSValBuilder() + .evalBinOpNN(state, BO_GT, *strLengthNL, *maxlenValNL, cmpTy) + .castAs()); if (stateStringTooLong && !stateStringNotTooLong) { // If the string is longer than maxlen, return maxlen. @@ -1381,7 +1381,7 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallExpr *CE, // Check if the max number to copy is less than the length of the src. // If the bound is equal to the source length, strncpy won't null- // terminate the result! - llvm::tie(stateSourceTooLong, stateSourceNotTooLong) = state->assume( + std::tie(stateSourceTooLong, stateSourceNotTooLong) = state->assume( svalBuilder.evalBinOpNN(state, BO_GE, *strLengthNL, *lenValNL, cmpTy) .castAs()); @@ -1428,7 +1428,7 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallExpr *CE, // case strncpy will do no work at all. Our bounds check uses n-1 // as the last element accessed, so n == 0 is problematic. ProgramStateRef StateZeroSize, StateNonZeroSize; - llvm::tie(StateZeroSize, StateNonZeroSize) = + std::tie(StateZeroSize, StateNonZeroSize) = assumeZero(C, state, *lenValNL, sizeTy); // If the size is known to be zero, we're done. @@ -1721,7 +1721,7 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE, SValBuilder &svalBuilder = C.getSValBuilder(); DefinedOrUnknownSVal SameBuf = svalBuilder.evalEQ(state, LV, RV); ProgramStateRef StSameBuf, StNotSameBuf; - llvm::tie(StSameBuf, StNotSameBuf) = state->assume(SameBuf); + std::tie(StSameBuf, StNotSameBuf) = state->assume(SameBuf); // If the two arguments might be the same buffer, we know the result is 0, // and we only need to check one size. diff --git a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp index 9d14e22f09..c0467b1e7e 100644 --- a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -241,8 +241,7 @@ void CallAndMessageChecker::checkPreStmt(const CallExpr *CE, } ProgramStateRef StNonNull, StNull; - llvm::tie(StNonNull, StNull) = - State->assume(L.castAs()); + std::tie(StNonNull, StNull) = State->assume(L.castAs()); if (StNull && !StNonNull) { if (!BT_call_null) @@ -297,7 +296,7 @@ void CallAndMessageChecker::checkPreCall(const CallEvent &Call, } ProgramStateRef StNonNull, StNull; - llvm::tie(StNonNull, StNull) = + std::tie(StNonNull, StNull) = State->assume(V.castAs()); if (StNull && !StNonNull) { @@ -402,7 +401,7 @@ void CallAndMessageChecker::checkPreObjCMessage(const ObjCMethodCall &msg, ProgramStateRef state = C.getState(); ProgramStateRef notNilState, nilState; - llvm::tie(notNilState, nilState) = state->assume(receiverVal); + std::tie(notNilState, nilState) = state->assume(receiverVal); // Handle receiver must be nil. if (nilState && !notNilState) { diff --git a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp index 6ca7879c12..bc9a77098d 100644 --- a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp @@ -201,7 +201,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S, ProgramStateRef state = C.getState(); ProgramStateRef notNullState, nullState; - llvm::tie(notNullState, nullState) = state->assume(location); + std::tie(notNullState, nullState) = state->assume(location); // The explicit NULL case. if (nullState) { @@ -240,8 +240,7 @@ void DereferenceChecker::checkBind(SVal L, SVal V, const Stmt *S, ProgramStateRef State = C.getState(); ProgramStateRef StNonNull, StNull; - llvm::tie(StNonNull, StNull) = - State->assume(V.castAs()); + std::tie(StNonNull, StNull) = State->assume(V.castAs()); if (StNull) { if (!StNonNull) { diff --git a/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp b/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp index 023d5af96e..ae76b563b0 100644 --- a/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp @@ -68,7 +68,7 @@ void DivZeroChecker::checkPreStmt(const BinaryOperator *B, // Check for divide by zero. ConstraintManager &CM = C.getConstraintManager(); ProgramStateRef stateNotZero, stateZero; - llvm::tie(stateNotZero, stateZero) = CM.assumeDual(C.getState(), *DV); + std::tie(stateNotZero, stateZero) = CM.assumeDual(C.getState(), *DV); if (!stateNotZero) { assert(stateZero); diff --git a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp index 411c1d1487..ff36762503 100644 --- a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -68,7 +68,7 @@ static const char *getArgumentValueString(const CallExpr *CE, return "UNDEFINED"; ProgramStateRef StTrue, StFalse; - llvm::tie(StTrue, StFalse) = + std::tie(StTrue, StFalse) = State->assume(AssertionVal.castAs()); if (StTrue) { diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index eaf57cc668..de615a88b3 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -980,7 +980,7 @@ ProgramStateRef MallocChecker::FreeMemAux(CheckerContext &C, // The explicit NULL case, no operation is performed. ProgramStateRef notNullState, nullState; - llvm::tie(notNullState, nullState) = State->assume(location); + std::tie(notNullState, nullState) = State->assume(location); if (nullState && !notNullState) return 0; @@ -1505,9 +1505,9 @@ ProgramStateRef MallocChecker::ReallocMem(CheckerContext &C, svalBuilder.makeIntValWithPtrWidth(0, false)); ProgramStateRef StatePtrIsNull, StatePtrNotNull; - llvm::tie(StatePtrIsNull, StatePtrNotNull) = state->assume(PtrEQ); + std::tie(StatePtrIsNull, StatePtrNotNull) = state->assume(PtrEQ); ProgramStateRef StateSizeIsZero, StateSizeNotZero; - llvm::tie(StateSizeIsZero, StateSizeNotZero) = state->assume(SizeZero); + std::tie(StateSizeIsZero, StateSizeNotZero) = state->assume(SizeZero); // We only assume exceptional states if they are definitely true; if the // state is under-constrained, assume regular realloc behavior. bool PrtIsNull = StatePtrIsNull && !StatePtrNotNull; @@ -1666,7 +1666,7 @@ void MallocChecker::reportLeak(SymbolRef Sym, ExplodedNode *N, PathDiagnosticLocation LocUsedForUniqueing; const ExplodedNode *AllocNode = 0; const MemRegion *Region = 0; - llvm::tie(AllocNode, Region) = getAllocationSite(N, Sym, C); + std::tie(AllocNode, Region) = getAllocationSite(N, Sym, C); ProgramPoint P = AllocNode->getLocation(); const Stmt *AllocationStmt = 0; diff --git a/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp b/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp index f9a43ad803..bad2789983 100644 --- a/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp @@ -122,7 +122,7 @@ void NonNullParamChecker::checkPreCall(const CallEvent &Call, ConstraintManager &CM = C.getConstraintManager(); ProgramStateRef stateNotNull, stateNull; - llvm::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV); + std::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV); if (stateNull && !stateNotNull) { // Generate an error node. Check for a null node in case diff --git a/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp index 74929296b9..1fce2bbbea 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp @@ -60,7 +60,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S, // Check for null mutexes. ProgramStateRef notNullState, nullState; - llvm::tie(notNullState, nullState) = state->assume(V.castAs()); + std::tie(notNullState, nullState) = state->assume(V.castAs()); if (nullState) { if (!notNullState) { diff --git a/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp b/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp index ac76e0bf8c..5686562698 100644 --- a/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp @@ -120,10 +120,10 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE, ProgramStateRef lockFail; switch (semantics) { case PthreadSemantics: - llvm::tie(lockFail, lockSucc) = state->assume(retVal); + std::tie(lockFail, lockSucc) = state->assume(retVal); break; case XNUSemantics: - llvm::tie(lockSucc, lockFail) = state->assume(retVal); + std::tie(lockSucc, lockFail) = state->assume(retVal); break; default: llvm_unreachable("Unknown tryLock locking semantics"); diff --git a/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp b/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp index 5a4632518e..0eab41f257 100644 --- a/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp @@ -103,7 +103,7 @@ void ReturnUndefChecker::emitUndef(CheckerContext &C, const Expr *RetE) const { void ReturnUndefChecker::checkReference(CheckerContext &C, const Expr *RetE, DefinedOrUnknownSVal RetVal) const { ProgramStateRef StNonNull, StNull; - llvm::tie(StNonNull, StNull) = C.getState()->assume(RetVal); + std::tie(StNonNull, StNull) = C.getState()->assume(RetVal); if (StNonNull) { // Going forward, assume the location is non-null. diff --git a/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/lib/StaticAnalyzer/Checkers/StreamChecker.cpp index 7a4831b32a..17d6d8e1d5 100644 --- a/lib/StaticAnalyzer/Checkers/StreamChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/StreamChecker.cpp @@ -218,7 +218,7 @@ void StreamChecker::OpenFileAux(CheckerContext &C, const CallExpr *CE) const { // Bifurcate the state into two: one with a valid FILE* pointer, the other // with a NULL. ProgramStateRef stateNotNull, stateNull; - llvm::tie(stateNotNull, stateNull) = CM.assumeDual(state, RetVal); + std::tie(stateNotNull, stateNull) = CM.assumeDual(state, RetVal); if (SymbolRef Sym = RetVal.getAsSymbol()) { // if RetVal is not NULL, set the symbol's state to Opened. @@ -344,7 +344,7 @@ ProgramStateRef StreamChecker::CheckNullStream(SVal SV, ProgramStateRef state, ConstraintManager &CM = C.getConstraintManager(); ProgramStateRef stateNotNull, stateNull; - llvm::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV); + std::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV); if (!stateNotNull && stateNull) { if (ExplodedNode *N = C.generateSink(stateNull)) { diff --git a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp index 46ae858a08..bdf789d788 100644 --- a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp @@ -113,7 +113,7 @@ void UnixAPIChecker::CheckOpen(CheckerContext &C, const CallExpr *CE) const { // Check if maskedFlags is non-zero. ProgramStateRef trueState, falseState; - llvm::tie(trueState, falseState) = state->assume(maskedFlags); + std::tie(trueState, falseState) = state->assume(maskedFlags); // Only emit an error if the value of 'maskedFlags' is properly // constrained; @@ -193,7 +193,7 @@ static bool IsZeroByteAllocation(ProgramStateRef state, const SVal argVal, ProgramStateRef *trueState, ProgramStateRef *falseState) { - llvm::tie(*trueState, *falseState) = + std::tie(*trueState, *falseState) = state->assume(argVal.castAs()); return (*falseState && !*trueState); diff --git a/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp b/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp index a558c34856..966715be0f 100644 --- a/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp @@ -114,7 +114,7 @@ void VLASizeChecker::checkPreStmt(const DeclStmt *DS, CheckerContext &C) const { DefinedSVal sizeD = sizeV.castAs(); ProgramStateRef stateNotZero, stateZero; - llvm::tie(stateNotZero, stateZero) = state->assume(sizeD); + std::tie(stateNotZero, stateZero) = state->assume(sizeD); if (stateZero && !stateNotZero) { reportBug(VLA_Zero, SE, stateZero, C); diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index bf750a2227..5f88c5e2b4 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -2904,7 +2904,7 @@ TrimmedGraph::TrimmedGraph(const ExplodedGraph *OriginalGraph, PriorityMapTy::iterator PriorityEntry; bool IsNew; - llvm::tie(PriorityEntry, IsNew) = + std::tie(PriorityEntry, IsNew) = PriorityMap.insert(std::make_pair(Node, Priority)); ++Priority; @@ -2933,7 +2933,7 @@ bool TrimmedGraph::popNextReportGraph(ReportGraph &GraphWrapper) { return false; const ExplodedNode *OrigN; - llvm::tie(OrigN, GraphWrapper.Index) = ReportNodes.pop_back_val(); + std::tie(OrigN, GraphWrapper.Index) = ReportNodes.pop_back_val(); assert(PriorityMap.find(OrigN) != PriorityMap.end() && "error node not accessible from root"); @@ -3454,7 +3454,7 @@ void BugReporter::FlushReport(BugReport *exampleReport, PathDiagnosticPiece *piece = new PathDiagnosticEventPiece(L, exampleReport->getDescription()); BugReport::ranges_iterator Beg, End; - llvm::tie(Beg, End) = exampleReport->getRanges(); + std::tie(Beg, End) = exampleReport->getRanges(); for ( ; Beg != End; ++Beg) piece->addRange(*Beg); D->setEndOfPath(piece); diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 4c1edf5f74..ee20145a90 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -115,7 +115,7 @@ BugReporterVisitor::getDefaultEndPath(BugReporterContext &BRC, PathDiagnosticLocation::createEndOfPath(EndPathNode,BRC.getSourceManager()); BugReport::ranges_iterator Beg, End; - llvm::tie(Beg, End) = BR.getRanges(); + std::tie(Beg, End) = BR.getRanges(); // Only add the statement itself as a range if we didn't specify any // special ranges for this report. diff --git a/lib/StaticAnalyzer/Core/CheckerRegistry.cpp b/lib/StaticAnalyzer/Core/CheckerRegistry.cpp index 1937ecf2c3..d4afedaba6 100644 --- a/lib/StaticAnalyzer/Core/CheckerRegistry.cpp +++ b/lib/StaticAnalyzer/Core/CheckerRegistry.cpp @@ -84,10 +84,10 @@ void CheckerRegistry::addChecker(InitializationFunction fn, StringRef name, // Record the presence of the checker in its packages. StringRef packageName, leafName; - llvm::tie(packageName, leafName) = name.rsplit(PackageSeparator); + std::tie(packageName, leafName) = name.rsplit(PackageSeparator); while (!leafName.empty()) { Packages[packageName] += 1; - llvm::tie(packageName, leafName) = packageName.rsplit(PackageSeparator); + std::tie(packageName, leafName) = packageName.rsplit(PackageSeparator); } } diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index fbcd263082..fde466a527 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1466,7 +1466,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term, DefinedSVal V = X.castAs(); ProgramStateRef StTrue, StFalse; - tie(StTrue, StFalse) = PrevState->assume(V); + std::tie(StTrue, StFalse) = PrevState->assume(V); // Process the true branch. if (builder.isFeasible(true)) { @@ -2196,7 +2196,7 @@ void ExprEngine::evalEagerlyAssumeBinOpBifurcation(ExplodedNodeSet &Dst, geteagerlyAssumeBinOpBifurcationTags(); ProgramStateRef StateTrue, StateFalse; - tie(StateTrue, StateFalse) = state->assume(*SEV); + std::tie(StateTrue, StateFalse) = state->assume(*SEV); // First assume that the condition is true. if (StateTrue) { diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index d79d8fc688..91b072f66c 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -555,7 +555,7 @@ void ExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode *Pred, } else { DefinedOrUnknownSVal DefinedRHS = RHSVal.castAs(); ProgramStateRef StTrue, StFalse; - llvm::tie(StTrue, StFalse) = N->getState()->assume(DefinedRHS); + std::tie(StTrue, StFalse) = N->getState()->assume(DefinedRHS); if (StTrue) { if (StFalse) { // We can't constrain the value to 0 or 1. diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 04fa11a5ea..72af75dba7 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -162,7 +162,7 @@ void ExprEngine::removeDeadOnEndOfFunction(NodeBuilderContext& BC, // Find the last statement in the function and the corresponding basic block. const Stmt *LastSt = 0; const CFGBlock *Blk = 0; - llvm::tie(LastSt, Blk) = getLastStmt(Pred); + std::tie(LastSt, Blk) = getLastStmt(Pred); if (!Blk || !LastSt) { Dst.Add(Pred); return; @@ -231,7 +231,7 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) { // Find the last statement in the function and the corresponding basic block. const Stmt *LastSt = 0; const CFGBlock *Blk = 0; - llvm::tie(LastSt, Blk) = getLastStmt(CEBNode); + std::tie(LastSt, Blk) = getLastStmt(CEBNode); // Generate a CallEvent /before/ cleaning the state, so that we can get the // correct value for 'this' (if necessary). diff --git a/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp b/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp index d276d92446..57c04bf56e 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp @@ -165,7 +165,7 @@ void ExprEngine::VisitObjCMessage(const ObjCMessageExpr *ME, recVal.castAs(); ProgramStateRef notNilState, nilState; - llvm::tie(notNilState, nilState) = State->assume(receiverVal); + std::tie(notNilState, nilState) = State->assume(receiverVal); // There are three cases: can be nil or non-nil, must be nil, must be // non-nil. We ignore must be nil, and merge the rest two into non-nil. diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp index fd96e2b324..c9b96e4a48 100644 --- a/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -1386,7 +1386,7 @@ void BlockDataRegion::LazyInitializeReferencedVars() { AnalysisDeclContext *AC = getCodeRegion()->getAnalysisDeclContext(); AnalysisDeclContext::referenced_decls_iterator I, E; - llvm::tie(I, E) = AC->getReferencedBlockVars(BC->getDecl()); + std::tie(I, E) = AC->getReferencedBlockVars(BC->getDecl()); if (I == E) { ReferencedVars = (void*) 0x1; @@ -1406,7 +1406,7 @@ void BlockDataRegion::LazyInitializeReferencedVars() { for ( ; I != E; ++I) { const VarRegion *VR = 0; const VarRegion *OriginalVR = 0; - llvm::tie(VR, OriginalVR) = getCaptureRegions(*I); + std::tie(VR, OriginalVR) = getCaptureRegions(*I); assert(VR); assert(OriginalVR); BV->push_back(VR, BC); diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index 059e5137ae..992dfa955a 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -1626,7 +1626,7 @@ RegionStoreManager::getBindingForFieldOrElementCommon(RegionBindingsConstRef B, // Lazy binding? Store lazyBindingStore = NULL; const SubRegion *lazyBindingRegion = NULL; - llvm::tie(lazyBindingStore, lazyBindingRegion) = findLazyBinding(B, R, R); + std::tie(lazyBindingStore, lazyBindingRegion) = findLazyBinding(B, R, R); if (lazyBindingRegion) return getLazyBinding(lazyBindingRegion, getRegionBindings(lazyBindingStore)); diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 626910b280..62de61e2b5 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -314,7 +314,7 @@ bool CursorVisitor::visitDeclsFromFileRegion(FileID File, if (Outer.isInvalid()) return false; - llvm::tie(File, Offset) = SM.getDecomposedExpansionLoc(Outer); + std::tie(File, Offset) = SM.getDecomposedExpansionLoc(Outer); Length = 0; Unit->findFileRegionDecls(File, Offset, Length, Decls); } diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index 9b83aa00e9..29ecd1ccc7 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -219,7 +219,7 @@ private: assert(RegionLoc.isFileID()); FileID RegionFID; unsigned RegionOffset; - llvm::tie(RegionFID, RegionOffset) = SM.getDecomposedLoc(RegionLoc); + std::tie(RegionFID, RegionOffset) = SM.getDecomposedLoc(RegionLoc); if (RegionFID != FID) { if (isParsedOnceInclude(FE)) { @@ -375,7 +375,7 @@ public: FileID FID; unsigned Offset; - llvm::tie(FID, Offset) = SM.getDecomposedLoc(Loc); + std::tie(FID, Offset) = SM.getDecomposedLoc(Loc); // Don't skip bodies from main files; this may be revisited. if (SM.getMainFileID() == FID) return false; @@ -717,7 +717,7 @@ static void indexPreprocessingRecord(ASTUnit &Unit, IndexingContext &IdxCtx) { // FIXME: Only deserialize inclusion directives. PreprocessingRecord::iterator I, E; - llvm::tie(I, E) = Unit.getLocalPreprocessingEntities(); + std::tie(I, E) = Unit.getLocalPreprocessingEntities(); bool isModuleFile = Unit.isModuleFile(); for (; I != E; ++I) {