[PATCH] D113593: [analyzer][NFC] CallDescription should own the qualified name parts
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 19 09:33:22 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGde9d7e42aca2: [analyzer][NFC] CallDescription should own the qualified name parts (authored by steakhal).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113593/new/
https://reviews.llvm.org/D113593
Files:
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
clang/lib/StaticAnalyzer/Core/CallDescription.cpp
Index: clang/lib/StaticAnalyzer/Core/CallDescription.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/CallDescription.cpp
+++ clang/lib/StaticAnalyzer/Core/CallDescription.cpp
@@ -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 @@
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.
Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
===================================================================
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
@@ -43,7 +43,7 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113593.388536.patch
Type: text/x-patch
Size: 1721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211119/b787dfe7/attachment.bin>
More information about the cfe-commits
mailing list