diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-23 22:46:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-23 22:46:22 +0000 |
commit | dc0d73e6495404418acf8548875aeaff07791a74 (patch) | |
tree | b29a024bb736640a843f484dea0571c08d1ae3f8 | |
parent | f11ccfcd7b1ad777d940503432b565dce624f4b6 (diff) |
fix bogus warnings about potentially uninit vars Size and Align.
Patch by Neil Booth!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40452 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/ASTContext.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp index 3e1f32ded8..a9fb81faad 100644 --- a/AST/ASTContext.cpp +++ b/AST/ASTContext.cpp @@ -227,14 +227,14 @@ ASTContext::getTypeInfo(QualType T, SourceLocation L) { break; } case Type::Tagged: - if (RecordType *RT = dyn_cast<RecordType>(cast<TagType>(T))) { - const RecordLayout &Layout = getRecordLayout(RT->getDecl(), L); - Size = Layout.getSize(); - Align = Layout.getAlignment(); - break; - } - // FIXME: Handle enums. - assert(0 && "Unimplemented type sizes!"); + RecordType *RT = dyn_cast<RecordType>(cast<TagType>(T)); + if (!RT) + // FIXME: Handle enums. + assert(0 && "Unimplemented type sizes!"); + const RecordLayout &Layout = getRecordLayout(RT->getDecl(), L); + Size = Layout.getSize(); + Align = Layout.getAlignment(); + break; } assert(Align && (Align & (Align-1)) == 0 && "Alignment must be power of 2"); |