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;
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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits