IR: Fix -Werror noasserts build after r234255
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 23:34:41 +0000 (23:34 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 23:34:41 +0000 (23:34 +0000)
llvm-svn: 234259

llvm/lib/IR/DIBuilder.cpp

index 662b1df..a6e3d3b 100644 (file)
@@ -576,10 +576,12 @@ DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) {
 }
 
 static void checkGlobalVariableScope(DIDescriptor Context) {
+#ifndef NDEBUG
   if (DICompositeType CT =
           dyn_cast_or_null<MDCompositeType>(getNonCompileUnitScope(Context)))
     assert(!CT.getIdentifier() &&
            "Context of a global variable should not be a type with identifier");
+#endif
 }
 
 DIGlobalVariable DIBuilder::createGlobalVariable(