summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-12 18:22:07 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-12 18:22:07 +0000
commit660e29828b738ddbf65f515a036c21bea3cf70a7 (patch)
tree8f45376fccd29fae8121aa05c7873e845fdb27fd
parent7e6bfb4a0d414a65304cb42d7fcc4360b751c767 (diff)
downloadbcm5719-llvm-660e29828b738ddbf65f515a036c21bea3cf70a7.tar.gz
bcm5719-llvm-660e29828b738ddbf65f515a036c21bea3cf70a7.zip
Delete StructType bodies when destroying a StructType.
Leak found by valgrind. llvm-svn: 134994
-rw-r--r--llvm/include/llvm/DerivedTypes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/DerivedTypes.h b/llvm/include/llvm/DerivedTypes.h
index 0f1e99f1349..acb28deada1 100644
--- a/llvm/include/llvm/DerivedTypes.h
+++ b/llvm/include/llvm/DerivedTypes.h
@@ -190,6 +190,10 @@ class StructType : public CompositeType {
///
void *SymbolTableEntry;
public:
+ ~StructType() {
+ delete [] ContainedTys; // Delete the body.
+ }
+
/// StructType::createNamed - This creates a named struct with no body
/// specified. If the name is empty, it creates an unnamed struct, which has
/// a unique identity but no actual name.
OpenPOWER on IntegriCloud