summaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-09-25 22:13:31 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-09-25 22:13:31 +0000
commit7c8e954f273730037b454edf94c8d13123dbedf6 (patch)
treefabebb6671d3b629f967a0380890d641b8be2e92 /include/clang
parent730c7ae40ea09e0e0209d0e092322e5eeec9b3cd (diff)
downloadclang-7c8e954f273730037b454edf94c8d13123dbedf6.tar.gz
[analyzer] NFC: CallDescription: Improve array management.
Combine the two constructor overrides into a single ArrayRef constructor to allow easier brace initializations and simplify how the respective field is used internally. Differential Revision: https://reviews.llvm.org/D51390 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index f8b2cf7064..4c50eafbde 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -82,7 +82,7 @@ class CallDescription {
mutable bool IsLookupDone = false;
// The list of the qualified names used to identify the specified CallEvent,
// e.g. "{a, b}" represent the qualified names, like "a::b".
- std::vector<StringRef> QualifiedName;
+ std::vector<const char *> QualifiedName;
unsigned RequiredArgs;
public:
@@ -90,29 +90,18 @@ public:
/// Constructs a CallDescription object.
///
- /// @param QualifiedName The list of the qualified names of the function that
- /// will be matched. It does not require the user to provide the full list of
- /// the qualified name. The more details provided, the more accurate the
- /// matching.
+ /// @param QualifiedName The list of the name qualifiers of the function that
+ /// will be matched. The user is allowed to skip any of the qualifiers.
+ /// For example, {"std", "basic_string", "c_str"} would match both
+ /// std::basic_string<...>::c_str() and std::__1::basic_string<...>::c_str().
///
/// @param RequiredArgs The number of arguments that is expected to match a
/// call. Omit this parameter to match every occurrence of call with a given
/// name regardless the number of arguments.
- CallDescription(std::vector<StringRef> QualifiedName,
+ CallDescription(ArrayRef<const char *> QualifiedName,
unsigned RequiredArgs = NoArgRequirement)
: QualifiedName(QualifiedName), RequiredArgs(RequiredArgs) {}
- /// Constructs a CallDescription object.
- ///
- /// @param FuncName The name of the function that will be matched.
- ///
- /// @param RequiredArgs The number of arguments that is expected to match a
- /// call. Omit this parameter to match every occurrence of call with a given
- /// name regardless the number of arguments.
- CallDescription(StringRef FuncName, unsigned RequiredArgs = NoArgRequirement)
- : CallDescription(std::vector<StringRef>({FuncName}), NoArgRequirement) {
- }
-
/// Get the name of the function that this object matches.
StringRef getFunctionName() const { return QualifiedName.back(); }
};