diff options
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 26 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 28 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 4 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SMTConstraintManager.cpp | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/WorkList.cpp | 12 |
6 files changed, 37 insertions, 37 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index f5a51405b48..4cfcdee1c3a 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1263,7 +1263,7 @@ void PathDiagnosticBuilder::generatePathDiagnosticsForNode( static std::unique_ptr<PathDiagnostic> generateEmptyDiagnosticForReport(const BugReport *R, const SourceManager &SM) { const BugType &BT = R->getBugType(); - return llvm::make_unique<PathDiagnostic>( + return std::make_unique<PathDiagnostic>( R->getBugType().getCheckName(), R->getDeclWithIssue(), R->getBugType().getName(), R->getDescription(), R->getShortDescription(/*UseFallback=*/false), BT.getCategory(), @@ -2391,7 +2391,7 @@ BugPathInfo *BugPathGetter::getNextBugPath() { // Create a new graph with a single path. This is the graph that will be // returned to the caller. - auto GNew = llvm::make_unique<ExplodedGraph>(); + auto GNew = std::make_unique<ExplodedGraph>(); CurrentBugPath.MapToOriginNodes.clear(); // Now walk from the error node up the BFS path, always taking the @@ -2533,7 +2533,7 @@ static std::unique_ptr<VisitorsDiagnosticsTy> generateVisitorsDiagnostics(BugReport *R, const ExplodedNode *ErrorNode, BugReporterContext &BRC) { std::unique_ptr<VisitorsDiagnosticsTy> Notes = - llvm::make_unique<VisitorsDiagnosticsTy>(); + std::make_unique<VisitorsDiagnosticsTy>(); BugReport::VisitorList visitors; // Run visitors on all nodes starting from the node *before* the last one. @@ -2599,12 +2599,12 @@ PathDiagnosticBuilder::findValidReport(ArrayRef<BugReport *> &bugReports, // Register refutation visitors first, if they mark the bug invalid no // further analysis is required - R->addVisitor(llvm::make_unique<LikelyFalsePositiveSuppressionBRVisitor>()); + R->addVisitor(std::make_unique<LikelyFalsePositiveSuppressionBRVisitor>()); // Register additional node visitors. - R->addVisitor(llvm::make_unique<NilReceiverBRVisitor>()); - R->addVisitor(llvm::make_unique<ConditionBRVisitor>()); - R->addVisitor(llvm::make_unique<TagVisitor>()); + R->addVisitor(std::make_unique<NilReceiverBRVisitor>()); + R->addVisitor(std::make_unique<ConditionBRVisitor>()); + R->addVisitor(std::make_unique<TagVisitor>()); BugReporterContext BRC(Reporter, BugPath->MapToOriginNodes); @@ -2617,7 +2617,7 @@ PathDiagnosticBuilder::findValidReport(ArrayRef<BugReport *> &bugReports, // If crosscheck is enabled, remove all visitors, add the refutation // visitor and check again R->clearVisitors(); - R->addVisitor(llvm::make_unique<FalsePositiveRefutationBRVisitor>()); + R->addVisitor(std::make_unique<FalsePositiveRefutationBRVisitor>()); // We don't overrite the notes inserted by other visitors because the // refutation manager does not add any new note to the path @@ -2641,7 +2641,7 @@ GRBugReporter::generatePathDiagnostics( ArrayRef<BugReport *> &bugReports) { assert(!bugReports.empty()); - auto Out = llvm::make_unique<DiagnosticForConsumerMapTy>(); + auto Out = std::make_unique<DiagnosticForConsumerMapTy>(); Optional<PathDiagnosticBuilder> PDB = PathDiagnosticBuilder::findValidReport(bugReports, *this); @@ -2841,7 +2841,7 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) { // of the issue. if (PD->path.empty()) { PathDiagnosticLocation L = report->getLocation(getSourceManager()); - auto piece = llvm::make_unique<PathDiagnosticEventPiece>( + auto piece = std::make_unique<PathDiagnosticEventPiece>( L, report->getDescription()); for (SourceRange Range : report->getRanges()) piece->addRange(Range); @@ -2921,7 +2921,7 @@ static void populateExecutedLinesWithStmt( /// starting from \p N. static std::unique_ptr<FilesToLineNumsMap> findExecutedLines(const SourceManager &SM, const ExplodedNode *N) { - auto ExecutedLines = llvm::make_unique<FilesToLineNumsMap>(); + auto ExecutedLines = std::make_unique<FilesToLineNumsMap>(); while (N) { if (N->getFirstPred() == nullptr) { @@ -2961,7 +2961,7 @@ BugReporter::generateDiagnosticForConsumerMap( ArrayRef<BugReport *> bugReports) { if (!report->isPathSensitive()) { - auto Out = llvm::make_unique<DiagnosticForConsumerMapTy>(); + auto Out = std::make_unique<DiagnosticForConsumerMapTy>(); for (auto *Consumer : consumers) (*Out)[Consumer] = generateEmptyDiagnosticForReport(report, getSourceManager()); @@ -3008,7 +3008,7 @@ void BugReporter::EmitBasicReport(const Decl *DeclWithIssue, ArrayRef<SourceRange> Ranges) { // 'BT' is owned by BugReporter. BugType *BT = getBugTypeForName(CheckName, name, category); - auto R = llvm::make_unique<BugReport>(*BT, str, Loc); + auto R = std::make_unique<BugReport>(*BT, str, Loc); R->setDeclWithIssue(DeclWithIssue); for (ArrayRef<SourceRange>::iterator I = Ranges.begin(), E = Ranges.end(); I != E; ++I) diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 43347ed247a..9850349f6ba 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -789,7 +789,7 @@ public: AnalyzerOptions &Options = N->getState()->getAnalysisManager().options; if (EnableNullFPSuppression && Options.ShouldSuppressNullReturnPaths && V.getAs<Loc>()) - BR.addVisitor(llvm::make_unique<MacroNullReturnSuppressionVisitor>( + BR.addVisitor(std::make_unique<MacroNullReturnSuppressionVisitor>( R->getAs<SubRegion>(), V)); } @@ -951,7 +951,7 @@ public: if (Optional<Loc> RetLoc = RetVal.getAs<Loc>()) EnableNullFPSuppression = State->isNull(*RetLoc).isConstrainedTrue(); - BR.addVisitor(llvm::make_unique<ReturnVisitor>(CalleeContext, + BR.addVisitor(std::make_unique<ReturnVisitor>(CalleeContext, EnableNullFPSuppression, Options, TKind)); } @@ -1190,7 +1190,7 @@ void FindLastStoreBRVisitor::registerStatementVarDecls( if (V.getAs<loc::ConcreteInt>() || V.getAs<nonloc::ConcreteInt>()) { // Register a new visitor with the BugReport. - BR.addVisitor(llvm::make_unique<FindLastStoreBRVisitor>( + BR.addVisitor(std::make_unique<FindLastStoreBRVisitor>( V.castAs<KnownSVal>(), R, EnableNullFPSuppression, TKind)); } } @@ -1468,7 +1468,7 @@ FindLastStoreBRVisitor::VisitNode(const ExplodedNode *Succ, dyn_cast_or_null<BlockDataRegion>(V.getAsRegion())) { if (const VarRegion *OriginalR = BDR->getOriginalRegion(VR)) { if (auto KV = State->getSVal(OriginalR).getAs<KnownSVal>()) - BR.addVisitor(llvm::make_unique<FindLastStoreBRVisitor>( + BR.addVisitor(std::make_unique<FindLastStoreBRVisitor>( *KV, OriginalR, EnableNullFPSuppression, TKind, OriginSFC)); } } @@ -1926,7 +1926,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, // TODO: Shouldn't we track control dependencies of every bug location, rather // than only tracked expressions? if (LVState->getAnalysisManager().getAnalyzerOptions().ShouldTrackConditions) - report.addVisitor(llvm::make_unique<TrackControlDependencyCondBRVisitor>( + report.addVisitor(std::make_unique<TrackControlDependencyCondBRVisitor>( InputNode)); // The message send could be nil due to the receiver being nil. @@ -1954,7 +1954,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, // got initialized. if (RR && !LVIsNull) if (auto KV = LVal.getAs<KnownSVal>()) - report.addVisitor(llvm::make_unique<FindLastStoreBRVisitor>( + report.addVisitor(std::make_unique<FindLastStoreBRVisitor>( *KV, RR, EnableNullFPSuppression, TKind, SFC)); // In case of C++ references, we want to differentiate between a null @@ -1969,17 +1969,17 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, // Mark both the variable region and its contents as interesting. SVal V = LVState->getRawSVal(loc::MemRegionVal(R)); report.addVisitor( - llvm::make_unique<NoStoreFuncVisitor>(cast<SubRegion>(R))); + std::make_unique<NoStoreFuncVisitor>(cast<SubRegion>(R))); MacroNullReturnSuppressionVisitor::addMacroVisitorIfNecessary( LVNode, R, EnableNullFPSuppression, report, V); report.markInteresting(V); - report.addVisitor(llvm::make_unique<UndefOrNullArgVisitor>(R)); + report.addVisitor(std::make_unique<UndefOrNullArgVisitor>(R)); // If the contents are symbolic, find out when they became null. if (V.getAsLocSymbol(/*IncludeBaseRegions*/ true)) - report.addVisitor(llvm::make_unique<TrackConstraintBRVisitor>( + report.addVisitor(std::make_unique<TrackConstraintBRVisitor>( V.castAs<DefinedSVal>(), false)); // Add visitor, which will suppress inline defensive checks. @@ -1987,11 +1987,11 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, if (!DV->isZeroConstant() && LVState->isNull(*DV).isConstrainedTrue() && EnableNullFPSuppression) report.addVisitor( - llvm::make_unique<SuppressInlineDefensiveChecksVisitor>(*DV, + std::make_unique<SuppressInlineDefensiveChecksVisitor>(*DV, LVNode)); if (auto KV = V.getAs<KnownSVal>()) - report.addVisitor(llvm::make_unique<FindLastStoreBRVisitor>( + report.addVisitor(std::make_unique<FindLastStoreBRVisitor>( *KV, R, EnableNullFPSuppression, TKind, SFC)); return true; } @@ -2006,7 +2006,7 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, // Is it a symbolic value? if (auto L = V.getAs<loc::MemRegionVal>()) { - report.addVisitor(llvm::make_unique<UndefOrNullArgVisitor>(L->getRegion())); + report.addVisitor(std::make_unique<UndefOrNullArgVisitor>(L->getRegion())); // FIXME: this is a hack for fixing a later crash when attempting to // dereference a void* pointer. @@ -2030,13 +2030,13 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode, if (CanDereference) if (auto KV = RVal.getAs<KnownSVal>()) - report.addVisitor(llvm::make_unique<FindLastStoreBRVisitor>( + report.addVisitor(std::make_unique<FindLastStoreBRVisitor>( *KV, L->getRegion(), EnableNullFPSuppression, TKind, SFC)); const MemRegion *RegionRVal = RVal.getAsRegion(); if (RegionRVal && isa<SymbolicRegion>(RegionRVal)) { report.markInteresting(RegionRVal); - report.addVisitor(llvm::make_unique<TrackConstraintBRVisitor>( + report.addVisitor(std::make_unique<TrackConstraintBRVisitor>( loc::MemRegionVal(RegionRVal), /*assumption=*/false)); } } diff --git a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp index 64724227395..9752a0e2283 100644 --- a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp @@ -330,7 +330,7 @@ private: std::unique_ptr<ConstraintManager> ento::CreateRangeConstraintManager(ProgramStateManager &StMgr, SubEngine *Eng) { - return llvm::make_unique<RangeConstraintManager>(Eng, StMgr.getSValBuilder()); + return std::make_unique<RangeConstraintManager>(Eng, StMgr.getSValBuilder()); } bool RangeConstraintManager::canReasonAbout(SVal X) const { diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index 34592208945..86468e44aa0 100644 --- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -644,14 +644,14 @@ public: // Part of public interface to class. std::unique_ptr<StoreManager> ento::CreateRegionStoreManager(ProgramStateManager &StMgr) { RegionStoreFeatures F = maximal_features_tag(); - return llvm::make_unique<RegionStoreManager>(StMgr, F); + return std::make_unique<RegionStoreManager>(StMgr, F); } std::unique_ptr<StoreManager> ento::CreateFieldsOnlyRegionStoreManager(ProgramStateManager &StMgr) { RegionStoreFeatures F = minimal_features_tag(); F.enableFields(true); - return llvm::make_unique<RegionStoreManager>(StMgr, F); + return std::make_unique<RegionStoreManager>(StMgr, F); } diff --git a/clang/lib/StaticAnalyzer/Core/SMTConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/SMTConstraintManager.cpp index d5c14351d33..6ad12ca0a68 100644 --- a/clang/lib/StaticAnalyzer/Core/SMTConstraintManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/SMTConstraintManager.cpp @@ -14,5 +14,5 @@ using namespace ento; std::unique_ptr<ConstraintManager> ento::CreateZ3ConstraintManager(ProgramStateManager &StMgr, SubEngine *Eng) { - return llvm::make_unique<SMTConstraintManager>(Eng, StMgr.getSValBuilder()); + return std::make_unique<SMTConstraintManager>(Eng, StMgr.getSValBuilder()); } diff --git a/clang/lib/StaticAnalyzer/Core/WorkList.cpp b/clang/lib/StaticAnalyzer/Core/WorkList.cpp index 129d1720395..348552ba73a 100644 --- a/clang/lib/StaticAnalyzer/Core/WorkList.cpp +++ b/clang/lib/StaticAnalyzer/Core/WorkList.cpp @@ -79,11 +79,11 @@ public: WorkList::~WorkList() = default; std::unique_ptr<WorkList> WorkList::makeDFS() { - return llvm::make_unique<DFS>(); + return std::make_unique<DFS>(); } std::unique_ptr<WorkList> WorkList::makeBFS() { - return llvm::make_unique<BFS>(); + return std::make_unique<BFS>(); } namespace { @@ -124,7 +124,7 @@ namespace { } // namespace std::unique_ptr<WorkList> WorkList::makeBFSBlockDFSContents() { - return llvm::make_unique<BFSBlockDFSContents>(); + return std::make_unique<BFSBlockDFSContents>(); } namespace { @@ -186,7 +186,7 @@ public: } // namespace std::unique_ptr<WorkList> WorkList::makeUnexploredFirst() { - return llvm::make_unique<UnexploredFirstStack>(); + return std::make_unique<UnexploredFirstStack>(); } namespace { @@ -249,7 +249,7 @@ public: } // namespace std::unique_ptr<WorkList> WorkList::makeUnexploredFirstPriorityQueue() { - return llvm::make_unique<UnexploredFirstPriorityQueue>(); + return std::make_unique<UnexploredFirstPriorityQueue>(); } namespace { @@ -309,5 +309,5 @@ public: } std::unique_ptr<WorkList> WorkList::makeUnexploredFirstPriorityLocationQueue() { - return llvm::make_unique<UnexploredFirstPriorityLocationQueue>(); + return std::make_unique<UnexploredFirstPriorityLocationQueue>(); } |