Use proper return type for attribute index.
[oota-llvm.git] / lib / IR / LLVMContextImpl.cpp
index 61fb7f37d49d0ff5a8ca28078a5b2e017e08aa82..89e163f5141256e8ba79d8e3f9b0e4e23aa74488 100644 (file)
@@ -13,8 +13,8 @@
 
 #include "LLVMContextImpl.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Attributes.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Attributes.h"
+#include "llvm/IR/Module.h"
 #include <algorithm>
 using namespace llvm;
 
@@ -109,6 +109,13 @@ LLVMContextImpl::~LLVMContextImpl() {
     delete &*Elem;
   }
 
+  // Destroy attribute node lists.
+  for (FoldingSetIterator<AttributeSetNode> I = AttrsSetNodes.begin(),
+         E = AttrsSetNodes.end(); I != E; ) {
+    FoldingSetIterator<AttributeSetNode> Elem = I++;
+    delete &*Elem;
+  }
+
   // Destroy MDNodes.  ~MDNode can move and remove nodes between the MDNodeSet
   // and the NonUniquedMDNodes sets, so copy the values out first.
   SmallVector<MDNode*, 8> MDNodes;