summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-09-26 21:07:29 +0000
committerBill Wendling <isanbard@gmail.com>2012-09-26 21:07:29 +0000
commite38b804d0775123aae2b0916d20f079e3f06acf8 (patch)
tree39d927ebeb322e4df89872d1e8917fc51965966e /llvm/lib/VMCore/LLVMContextImpl.cpp
parent7fc726539f9faf3e9a312e9608f87e050d3003ed (diff)
downloadbcm5719-llvm-e38b804d0775123aae2b0916d20f079e3f06acf8.tar.gz
bcm5719-llvm-e38b804d0775123aae2b0916d20f079e3f06acf8.zip
Initial commit for the AttributesImpl class.
This opaque class will contain all of the attributes. All attribute queries will go through this object. This object will also be uniqued in the LLVMContext. Currently not used, so no implementation change. llvm-svn: 164722
Diffstat (limited to 'llvm/lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r--llvm/lib/VMCore/LLVMContextImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/LLVMContextImpl.cpp b/llvm/lib/VMCore/LLVMContextImpl.cpp
index 6279bb823db..a86363b632a 100644
--- a/llvm/lib/VMCore/LLVMContextImpl.cpp
+++ b/llvm/lib/VMCore/LLVMContextImpl.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "LLVMContextImpl.h"
+#include "llvm/Attributes.h"
#include "llvm/Module.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
@@ -93,6 +94,11 @@ LLVMContextImpl::~LLVMContextImpl() {
E = CDSConstants.end(); I != E; ++I)
delete I->second;
CDSConstants.clear();
+
+ // Destroy attributes.
+ for (FoldingSetIterator<AttributesImpl> I = AttrsSet.begin(),
+ E = AttrsSet.end(); I != E; ++I)
+ delete &*I;
// Destroy MDNodes. ~MDNode can move and remove nodes between the MDNodeSet
// and the NonUniquedMDNodes sets, so copy the values out first.
@@ -107,6 +113,7 @@ LLVMContextImpl::~LLVMContextImpl() {
(*I)->destroy();
assert(MDNodeSet.empty() && NonUniquedMDNodes.empty() &&
"Destroying all MDNodes didn't empty the Context's sets.");
+
// Destroy MDStrings.
DeleteContainerSeconds(MDStringCache);
}
OpenPOWER on IntegriCloud