Add static functions to clear singleton maps. Patch contributed by

Morten Ofstad!

llvm-svn: 17994
This commit is contained in:
Chris Lattner 2004-11-19 16:39:04 +00:00
parent 8943604aeb
commit 083ce459c7
2 changed files with 12 additions and 1 deletions

View File

@ -92,6 +92,11 @@ public:
"implemented for all constants that have operands!");
assert(0 && "Constants that do not have operands cannot be using 'From'!");
}
/// clearAllValueMaps - This method frees all internal memory used by the
/// constant subsystem, which can be used in environments where this memory
/// is otherwise reported as a leak.
static void clearAllValueMaps();
};
} // End llvm namespace

View File

@ -288,7 +288,7 @@ public:
}
void dropRef() const {
assert(isAbstract() && "Cannot drop a refernce to a non-abstract type!");
assert(isAbstract() && "Cannot drop a reference to a non-abstract type!");
assert(RefCount && "No objects are currently referencing this object!");
// If this is the last PATypeHolder using this object, and there are no
@ -296,6 +296,12 @@ public:
if (--RefCount == 0)
RefCountIsZero();
}
/// clearAllTypeMaps - This method frees all internal memory used by the
/// type subsystem, which can be used in environments where this memory is
/// otherwise reported as a leak.
static void clearAllTypeMaps();
private:
/// isSizedDerivedType - Derived types like structures and arrays are sized
/// iff all of the members of the type are sized as well. Since asking for