mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
Another attempt at fixing PR2975.
Types can have references to eachother, so we can't just call destroy on them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -137,6 +137,7 @@ public:
|
||||
///
|
||||
class PATypeHolder {
|
||||
mutable const Type *Ty;
|
||||
void destroy();
|
||||
public:
|
||||
PATypeHolder(const Type *ty) : Ty(ty) {
|
||||
addRef();
|
||||
@@ -145,7 +146,7 @@ public:
|
||||
addRef();
|
||||
}
|
||||
|
||||
~PATypeHolder() { dropRef(); }
|
||||
~PATypeHolder() { if (Ty) dropRef(); }
|
||||
|
||||
operator Type *() const { return get(); }
|
||||
Type *get() const;
|
||||
@@ -173,6 +174,7 @@ public:
|
||||
private:
|
||||
void addRef();
|
||||
void dropRef();
|
||||
friend class TypeMapBase;
|
||||
};
|
||||
|
||||
// simplify_type - Allow clients to treat uses just like values when using
|
||||
|
||||
Reference in New Issue
Block a user