Implement a proper function list in module, which auto-maintain the parent
pointer, and ensure that functions are deleted when the module is destroyed.

This exposed the fact that MLFunction had no dtor, and that the dtor in
CFGFunction was broken with cyclic references.  Fix both of these problems.

PiperOrigin-RevId: 206051666
diff --git a/lib/IR/AsmPrinter.cpp b/lib/IR/AsmPrinter.cpp
index e23964d..4fd7e61 100644
--- a/lib/IR/AsmPrinter.cpp
+++ b/lib/IR/AsmPrinter.cpp
@@ -157,8 +157,8 @@
 
 // Initializes module state, populating affine map state.
 void ModuleState::initialize(const Module *module) {
-  for (auto fn : module->functionList) {
-    visitFunction(fn);
+  for (auto &fn : *module) {
+    visitFunction(&fn);
   }
 }
 
@@ -236,8 +236,8 @@
     map->print(os);
     os << '\n';
   }
-  for (auto *fn : module->functionList)
-    print(fn);
+  for (auto const &fn : *module)
+    print(&fn);
 }
 
 void ModulePrinter::printAttribute(const Attribute *attr) {