[clang] [clang][dataflow] Add synthetic fields to `RecordStorageLocation` (PR #73860)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 06:22:11 PST 2023


================
@@ -88,12 +94,12 @@ class ScalarStorageLocation final : public StorageLocation {
 class RecordStorageLocation final : public StorageLocation {
 public:
   using FieldToLoc = llvm::DenseMap<const ValueDecl *, StorageLocation *>;
+  using SyntheticFieldMap = llvm::StringMap<StorageLocation *>;
----------------
martinboehme wrote:

This is an interesting idea, but I'm hesitant about mutating the `IdentifierTable` in something that is going to be used from a clang-tidy check, which will be sharing the `IdentifierTable` with other checks.

I suppose we could always create our own mapping from strings to integers or pointers of some sort, which could then serve as the keys for the `SyntheticFieldMap` -- but I would lean towards leaving this as a potential future optimization that we would do if this does indeed turn out to be a performance issue.

https://github.com/llvm/llvm-project/pull/73860


More information about the cfe-commits mailing list