Remove dependency on libutils.

As part of this, TypeDef has also been converted to a NamedType. This is
because originally, Scope contained just a KeyedVector<localname, idx> of
types which it contained, and an std::vector<type> which idx indexes into
(KeyedVector<localname, type> alone would have also worked). However, now
it contains a std::map<localname, idx> instead. Because of this, we have lost
the ability to iterate over the keys (localnames) in O(n). By converting
TypeDef to a NamedType, name => idx => type such that name == type->name.
This also means that in function hierarchy calling Scope::addType, we no
longer have to pass around the tuple (name, type) since type->name == name,
and we can pass around only type.

Change-Id: I8f85afe0e389979a2fd98ff5eeccf47e3fcc8307
diff --git a/generateJava.cpp b/generateJava.cpp
index 51c66bc..f9b0cff 100644
--- a/generateJava.cpp
+++ b/generateJava.cpp
@@ -46,9 +46,8 @@
         const std::string &outputPath, const char *limitToType) const {
     // Splits types.hal up into one java file per declared type.
 
-    for (size_t i = 0; i < mRootScope->countTypes(); ++i) {
-        std::string typeName;
-        const Type *type = mRootScope->typeAt(i, &typeName);
+    for (const auto &type : mRootScope->getSubTypes()) {
+        std::string typeName = type->localName();
 
         if (type->isTypeDef()) {
             continue;