]> granicus.if.org Git - clang/commitdiff
Silence a warning about an unused variable in -Asserts builds
authorDouglas Gregor <dgregor@apple.com>
Wed, 11 Feb 2009 16:17:49 +0000 (16:17 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 11 Feb 2009 16:17:49 +0000 (16:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64306 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprConstant.cpp

index 838452d476c184888daba59f468d28878400bcaa..1f6da8a4142f3922788f20da3d2700f0c199fe27 100644 (file)
@@ -238,7 +238,6 @@ public:
   }
 
   llvm::Constant *EmitUnionInitialization(InitListExpr *ILE) {
-    RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl();
     const llvm::Type *Ty = ConvertType(ILE->getType());
 
     // If this is an empty initializer list, we value-initialize the
@@ -252,6 +251,7 @@ public:
 #ifndef NDEBUG
       // Make sure that it's really an empty and not a failure of
       // semantic analysis.
+      RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl();
       for (RecordDecl::field_iterator Field = RD->field_begin(),
                                    FieldEnd = RD->field_end();
            Field != FieldEnd; ++Field)