forked from OSchip/llvm-project
[analyzer][NFC] CallDescription should own the qualified name parts
Previously, CallDescription simply referred to the qualified name parts by `const char*` pointers. In the future we might want to dynamically load and populate `CallDescriptionMaps`, hence we will need the `CallDescriptions` to actually **own** their qualified name parts. Reviewed By: martong, xazax.hun Differential Revision: https://reviews.llvm.org/D113593
This commit is contained in:
parent
9ad0a90baa
commit
de9d7e42ac
|
@ -43,7 +43,7 @@ class CallDescription {
|
|||
mutable Optional<const IdentifierInfo *> II;
|
||||
// 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<const char *> QualifiedName;
|
||||
std::vector<std::string> QualifiedName;
|
||||
Optional<unsigned> RequiredArgs;
|
||||
Optional<size_t> RequiredParams;
|
||||
int Flags;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include <iterator>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace clang;
|
||||
|
@ -35,10 +36,12 @@ ento::CallDescription::CallDescription(
|
|||
int Flags, ArrayRef<const char *> QualifiedName,
|
||||
Optional<unsigned> RequiredArgs /*= None*/,
|
||||
Optional<size_t> RequiredParams /*= None*/)
|
||||
: QualifiedName(QualifiedName), RequiredArgs(RequiredArgs),
|
||||
: RequiredArgs(RequiredArgs),
|
||||
RequiredParams(readRequiredParams(RequiredArgs, RequiredParams)),
|
||||
Flags(Flags) {
|
||||
assert(!QualifiedName.empty());
|
||||
this->QualifiedName.reserve(QualifiedName.size());
|
||||
llvm::copy(QualifiedName, std::back_inserter(this->QualifiedName));
|
||||
}
|
||||
|
||||
/// Construct a CallDescription with default flags.
|
||||
|
|
Loading…
Reference in New Issue