That's just asking for ODR violations. Also drop a call to lower()
that's not needed.
namespace ento {
namespace smartptr {
-/// Set of STL smart pointer class which we are trying to model.
-const llvm::StringSet<> StdSmartPtrs = {
- "shared_ptr",
- "unique_ptr",
- "weak_ptr",
-};
-
/// Returns true if the event call is on smart pointer.
bool isStdSmartPtrCall(const CallEvent &Call);
return false;
if (RecordDecl->getDeclName().isIdentifier()) {
- return smartptr::StdSmartPtrs.count(RecordDecl->getName().lower());
+ StringRef Name = RecordDecl->getName();
+ return Name == "shared_ptr" || Name == "unique_ptr" || Name == "weak_ptr";
}
return false;
}