diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-14 00:06:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-14 00:06:42 +0000 |
commit | 2790383f7387f0770e08f36ccefc9b621d88f98b (patch) | |
tree | 9a9e5a0a7d8b2e110f61f8e58bbbea8b6e2673da | |
parent | 7e36c4730784c9571f7e73782c4b271e4c5ab6c4 (diff) |
Add a new InvalidateStructLayoutInfo method and some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25303 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/TargetData.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index f07c66bb86..1f031f2cc9 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -113,7 +113,16 @@ public: uint64_t getIndexedOffset(const Type *Ty, const std::vector<Value*> &Indices) const; + /// getStructLayout - Return a StructLayout object, indicating the alignment + /// of the struct, its size, and the offsets of its fields. Note that this + /// information is lazily cached. const StructLayout *getStructLayout(const StructType *Ty) const; + + /// InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout + /// objects. If a TargetData object is alive when types are being refined and + /// removed, this method must be called whenever a StructType is removed to + /// avoid a dangling pointer in this cache. + void InvalidateStructLayoutInfo(const StructType *Ty) const; }; /// StructLayout - used to lazily calculate structure layout information for a |