diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-08 00:13:39 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-08 00:13:39 +0000 |
| commit | a483eae2ff21d238ba3a872ef72ec7943acaefa2 (patch) | |
| tree | 0898bbf6d3ca171fb96b6d62154a77b1198c8d50 | |
| parent | ff5cafa2eca518617854b74810932ddda7185f4d (diff) | |
| download | bcm5719-llvm-a483eae2ff21d238ba3a872ef72ec7943acaefa2.tar.gz bcm5719-llvm-a483eae2ff21d238ba3a872ef72ec7943acaefa2.zip | |
IR: Call dropAllReferences from GlobalVariable's destructor.
We were previously failing to do this and as a result failing to drop
attached metadata.
Not sure if there's a good way to test this. An in-progress patch exposed this
problem by allocating a GlobalVariable at the same address as a previously
allocated GlobalVariable.
Differential Revision: http://reviews.llvm.org/D21109
llvm-svn: 272077
| -rw-r--r-- | llvm/include/llvm/IR/GlobalVariable.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/GlobalVariable.h b/llvm/include/llvm/IR/GlobalVariable.h index 7bc528775dd..ebeb635468d 100644 --- a/llvm/include/llvm/IR/GlobalVariable.h +++ b/llvm/include/llvm/IR/GlobalVariable.h @@ -65,6 +65,8 @@ public: bool isExternallyInitialized = false); ~GlobalVariable() override { + dropAllReferences(); + // FIXME: needed by operator delete setGlobalVariableNumOperands(1); } |

