diff options
Diffstat (limited to 'llvm/lib/VMCore/ConstantsContext.h')
-rw-r--r-- | llvm/lib/VMCore/ConstantsContext.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/ConstantsContext.h b/llvm/lib/VMCore/ConstantsContext.h index 22aba7e1d35..f4a2cde5d0f 100644 --- a/llvm/lib/VMCore/ConstantsContext.h +++ b/llvm/lib/VMCore/ConstantsContext.h @@ -575,6 +575,14 @@ public: // to enforce proper synchronization. typename MapTy::iterator map_begin() { return Map.begin(); } typename MapTy::iterator map_end() { return Map.end(); } + + void freeConstants() { + for (typename MapTy::iterator I=Map.begin(), E=Map.end(); + I != E; ++I) { + if (I->second->use_empty()) + delete I->second; + } + } /// InsertOrGetItem - Return an iterator for the specified element. /// If the element exists in the map, the returned iterator points to the |