[clang] 6c8b8a6 - [Checkers] Use std::optional in GenericTaintChecker.cpp (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 10 08:00:29 PST 2022
Author: Kazu Hirata
Date: 2022-12-10T08:00:24-08:00
New Revision: 6c8b8a6a2a52143d91af883dea30d8549e38cada
URL: https://github.com/llvm/llvm-project/commit/6c8b8a6a2a52143d91af883dea30d8549e38cada
DIFF: https://github.com/llvm/llvm-project/commit/6c8b8a6a2a52143d91af883dea30d8549e38cada.diff
LOG: [Checkers] Use std::optional in GenericTaintChecker.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Added:
Modified:
clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
Removed:
################################################################################
diff --git a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
index 863d82c87125..0f7973e74099 100644
--- a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
@@ -30,6 +30,7 @@
#include <limits>
#include <memory>
+#include <optional>
#include <utility>
#define DEBUG_TYPE "taint-checker"
@@ -360,8 +361,8 @@ class GenericTaintChecker : public Checker<check::PreCall, check::PostCall> {
// TODO: Remove separation to simplify matching logic once CallDescriptions
// are more expressive.
- mutable Optional<RuleLookupTy> StaticTaintRules;
- mutable Optional<RuleLookupTy> DynamicTaintRules;
+ mutable std::optional<RuleLookupTy> StaticTaintRules;
+ mutable std::optional<RuleLookupTy> DynamicTaintRules;
};
} // end of anonymous namespace
More information about the cfe-commits
mailing list