DebugInfo: Simplify a few more explicit constructions, underconstrained types, and...
[oota-llvm.git] / lib / IR / DIBuilder.cpp
index bdbba1b36e3c078e3400764eb1bccd4e18a43017..c4a9f4113060bbbf63184da9694d83104766a3e2 100644 (file)
@@ -752,11 +752,11 @@ DICompositeType DIBuilder::createEnumerationType(
     NULL,
     UniqueIdentifier.empty() ? NULL : MDString::get(VMContext, UniqueIdentifier)
   };
-  MDNode *Node = MDNode::get(VMContext, Elts);
-  AllEnumTypes.push_back(Node);
+  DICompositeType CTy(MDNode::get(VMContext, Elts));
+  AllEnumTypes.push_back(CTy);
   if (!UniqueIdentifier.empty())
-    retainType(Node);
-  return DICompositeType(Node);
+    retainType(CTy);
+  return CTy;
 }
 
 /// createArrayType - Create debugging information entry for an array.