diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 0d18bed..ee53dff 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -104,6 +104,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_compile_unit),
     createFilePathPair(VMContext, Filename, Directory),
+    NULL, // Imported modules
     ConstantInt::get(Type::getInt32Ty(VMContext), Lang),
     MDString::get(VMContext, Producer),
     ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized),
@@ -115,7 +116,9 @@
     TempGVs,
     MDString::get(VMContext, SplitName)
   };
-  TheCU = DICompileUnit(MDNode::get(VMContext, Elts));
+  DICompileUnit CU(MDNode::get(VMContext, Elts));
+  assert(CU.Verify() && "The compile unit should be valid");
+  TheCU = CU;
 
   // Create a named metadata so that it is easier to find cu in a module.
   NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
@@ -127,9 +130,12 @@
 DIFile DIBuilder::createFile(StringRef Filename, StringRef Directory) {
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_file_type),
-    createFilePathPair(VMContext, Filename, Directory)
+    createFilePathPair(VMContext, Filename, Directory),
+    NULL // Imported modules
   };
-  return DIFile(MDNode::get(VMContext, Elts));
+  DIFile F(MDNode::get(VMContext, Elts));
+  assert(F.Verify() && "The DIFile should be valid");
+  return F;
 }
 
 /// createEnumerator - Create a single enumerator value.
@@ -140,7 +146,9 @@
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt64Ty(VMContext), Val)
   };
-  return DIEnumerator(MDNode::get(VMContext, Elts));
+  DIEnumerator E(MDNode::get(VMContext, Elts));
+  assert(E.Verify() && "The enumerator should be valid");
+  return E;
 }
 
 /// createNullPtrType - Create C++0x nullptr type.
@@ -151,6 +159,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_type),
     NULL, // Filename
+    Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -160,7 +169,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags;
     ConstantInt::get(Type::getInt32Ty(VMContext), 0)  // Encoding
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The nullptr type should be valid");
+  return T;
 }
 
 /// createBasicType - Create debugging information entry for a basic
@@ -174,6 +185,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_base_type),
     NULL, // File/directory name
+    NULL, // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -183,7 +195,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags;
     ConstantInt::get(Type::getInt32Ty(VMContext), Encoding)
   };
-  return DIBasicType(MDNode::get(VMContext, Elts));
+  DIBasicType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The basic type should be valid");
+  return T;
 }
 
 /// createQualifiedType - Create debugging information entry for a qualified
@@ -193,6 +207,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, Tag),
     NULL, // Filename
+    NULL, // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, StringRef()), // Empty name.
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -202,7 +217,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
     FromTy
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The derived type should be valid");
+  return T;
 }
 
 /// createPointerType - Create debugging information entry for a pointer.
@@ -213,6 +230,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_pointer_type),
     NULL, // Filename
+    NULL, // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -222,7 +240,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
     PointeeTy
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The pointer type should be valid");
+  return T;
 }
 
 DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base) {
@@ -230,6 +250,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_ptr_to_member_type),
     NULL, // Filename
+    NULL, // Imported modules
     NULL, //TheCU,
     NULL,
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -240,7 +261,9 @@
     PointeeTy,
     Base
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The member pointer type should be valid");
+  return T;
 }
 
 /// createReferenceType - Create debugging information entry for a reference
@@ -251,6 +274,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, Tag),
     NULL, // Filename
+    NULL, // Imported modules
     NULL, // TheCU,
     NULL, // Name
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -260,7 +284,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
     RTy
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The reference type should be valid");
+  return T;
 }
 
 /// createTypedef - Create debugging information entry for a typedef.
@@ -271,6 +297,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Context),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
@@ -280,7 +307,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
     Ty
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The typedef Type should be valid");
+  return T;
 }
 
 /// createFriend - Create debugging information entry for a 'friend'.
@@ -291,6 +320,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_friend),
     NULL,
+    NULL, // Imported modules
     Ty,
     NULL, // Name
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -300,7 +330,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
     FriendTy
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The friend type should be valid");
+  return T;
 }
 
 /// createInheritance - Create debugging information entry to establish
@@ -312,6 +344,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_inheritance),
     NULL,
+    NULL, // Imported modules
     Ty,
     NULL, // Name
     ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
@@ -321,7 +354,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
     BaseTy
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The inheritance type should be valid");
+  return T;
 }
 
 /// createMemberType - Create debugging information entry for a member.
@@ -333,6 +368,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_member),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -342,7 +378,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
     Ty
   };
-  return DIDerivedType(MDNode::get(VMContext, Elts));
+  DIDerivedType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The member type should be valid");
+  return T;
 }
 
 /// createStaticMemberType - Create debugging information entry for a
@@ -356,6 +394,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_member),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -366,7 +405,9 @@
     Ty,
     Val
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The static member type should be valid");
+  return T;
 }
 
 /// createObjCIVar - Create debugging information entry for Objective-C
@@ -382,6 +423,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_member),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(File),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -395,7 +437,9 @@
     MDString::get(VMContext, SetterName),
     ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes)
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The Objective-C IVar type should be valid");
+  return T;
 }
 
 /// createObjCIVar - Create debugging information entry for Objective-C
@@ -409,6 +453,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_member),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(File),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -419,7 +464,9 @@
     Ty,
     PropertyNode
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The Objective-C IVar type should be valid");
+  return T;
 }
 
 /// createObjCProperty - Create debugging information entry for Objective-C
@@ -440,7 +487,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes),
     Ty
   };
-  return DIObjCProperty(MDNode::get(VMContext, Elts));
+  DIObjCProperty P(MDNode::get(VMContext, Elts));
+  assert(P.Verify() && "The Objective-C property should be valid");
+  return P;
 }
 
 /// createTemplateTypeParameter - Create debugging information for template
@@ -458,7 +507,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
     ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo)
   };
-  return DITemplateTypeParameter(MDNode::get(VMContext, Elts));
+  DITemplateTypeParameter P(MDNode::get(VMContext, Elts));
+  assert(P.Verify() && "The template type parameter should be valid");
+  return P;
 }
 
 /// createTemplateValueParameter - Create debugging information for template
@@ -478,7 +529,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
     ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo)
   };
-  return DITemplateValueParameter(MDNode::get(VMContext, Elts));
+  DITemplateValueParameter P(MDNode::get(VMContext, Elts));
+  assert(P.Verify() && "The template value parameter should be valid");
+  return P;
 }
 
 /// createClassType - Create debugging information entry for a class.
@@ -497,6 +550,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_class_type),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Context),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -529,6 +583,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_structure_type),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Context),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -556,6 +611,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_union_type),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -568,7 +624,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
     Constant::getNullValue(Type::getInt32Ty(VMContext))
   };
-  return DICompositeType(MDNode::get(VMContext, Elts));
+  DICompositeType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The union type should be valid");
+  return T;
 }
 
 /// createSubroutineType - Create subroutine type.
@@ -578,6 +636,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_subroutine_type),
     Constant::getNullValue(Type::getInt32Ty(VMContext)),
+    Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules
     Constant::getNullValue(Type::getInt32Ty(VMContext)),
     MDString::get(VMContext, ""),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
@@ -590,7 +649,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
     Constant::getNullValue(Type::getInt32Ty(VMContext))
   };
-  return DICompositeType(MDNode::get(VMContext, Elts));
+  DICompositeType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The subroutine type should be valid");
+  return T;
 }
 
 /// createEnumerationType - Create debugging information entry for an
@@ -603,6 +664,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
@@ -617,7 +679,9 @@
   };
   MDNode *Node = MDNode::get(VMContext, Elts);
   AllEnumTypes.push_back(Node);
-  return DICompositeType(Node);
+  DICompositeType T(Node);
+  assert(T.Verify() && "The enumeration type should be valid");
+  return T;
 }
 
 /// createArrayType - Create debugging information entry for an array.
@@ -627,6 +691,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_array_type),
     NULL, // Filename/Directory,
+    Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, ""),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
@@ -639,7 +704,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
     Constant::getNullValue(Type::getInt32Ty(VMContext))
   };
-  return DICompositeType(MDNode::get(VMContext, Elts));
+  DICompositeType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The array type should be valid");
+  return T;
 }
 
 /// createVectorType - Create debugging information entry for a vector.
@@ -650,6 +717,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_array_type),
     NULL, // Filename/Directory,
+    Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules
     NULL, //TheCU,
     MDString::get(VMContext, ""),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
@@ -662,7 +730,9 @@
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
     Constant::getNullValue(Type::getInt32Ty(VMContext))
   };
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The vector type should be valid");
+  return T;
 }
 
 /// createArtificialType - Create a new DIType with "artificial" flag set.
@@ -684,9 +754,11 @@
   CurFlags = CurFlags | DIType::FlagArtificial;
 
   // Flags are stored at this slot.
-  Elts[8] =  ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
+  Elts[9] =  ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
 
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The artificial type should be valid");
+  return T;
 }
 
 /// createObjectPointerType - Create a new type with both the object pointer
@@ -709,9 +781,11 @@
   CurFlags = CurFlags | (DIType::FlagObjectPointer | DIType::FlagArtificial);
 
   // Flags are stored at this slot.
-  Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
+  Elts[9] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags);
 
-  return DIType(MDNode::get(VMContext, Elts));
+  DIType T(MDNode::get(VMContext, Elts));
+  assert(T.Verify() && "The object pointer type should be valid");
+  return T;
 }
 
 /// retainType - Retain DIType in a module even if it is not referenced
@@ -740,6 +814,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, Tag),
     F.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), Line),
@@ -911,6 +986,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Context),
     MDString::get(VMContext, Name),
     MDString::get(VMContext, Name),
@@ -958,6 +1034,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
     F.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Context),
     MDString::get(VMContext, Name),
     MDString::get(VMContext, Name),
@@ -993,6 +1070,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_namespace),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     MDString::get(VMContext, Name),
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
@@ -1010,6 +1088,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
     File.getFileNode(),
+    NULL, // Imported modules
     Scope
   };
   DILexicalBlockFile R(MDNode::get(VMContext, Elts));
@@ -1026,6 +1105,7 @@
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
     File.getFileNode(),
+    NULL, // Imported modules
     getNonCompileUnitScope(Scope),
     ConstantInt::get(Type::getInt32Ty(VMContext), Line),
     ConstantInt::get(Type::getInt32Ty(VMContext), Col),
