Debug Info: instead of calling addToContextOwner which constructs the context
after the DIE creation, we construct the context first.

This touches creation of namespaces and global variables. The purpose is to
handle all DIE creations similarly: constructs the context first, then creates
the DIE and immediately adds the DIE to its parent.

We use createAndAddDIE to wrap around "new DIE(".

llvm-svn: 193589
diff --git a/llvm/test/DebugInfo/template-recursive-void.ll b/llvm/test/DebugInfo/template-recursive-void.ll
index ba45086..3ffb80b 100644
--- a/llvm/test/DebugInfo/template-recursive-void.ll
+++ b/llvm/test/DebugInfo/template-recursive-void.ll
@@ -13,7 +13,7 @@
 ; class bar : public foo<void> { };
 ; bar filters;
 
-; CHECK: DW_TAG_template_type_parameter [10]
+; CHECK: DW_TAG_template_type_parameter [{{.*}}]
 ; CHECK-NEXT: DW_AT_name{{.*}}"T"
 ; CHECK-NOT: DW_AT_type
 ; CHECK: NULL