diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-31 00:11:27 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-31 00:11:27 +0000 |
commit | 270e203b50ed8791e61afd357596bcf050cf2bfd (patch) | |
tree | 089b3fec31bd44d8157e878844ba91d24850dec0 /lib/CodeGen/CodeGenTypes.cpp | |
parent | bd63e02a0deb0fdaec708c7a4b4c7073937fd67d (diff) |
IRGen: Hide CGRecordLayoutBuilder class, because I can.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 2339640d45..8f341b51fb 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "CodeGenTypes.h" +#include "CGCall.h" #include "CGRecordLayout.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" @@ -21,10 +22,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/Target/TargetData.h" - -#include "CGCall.h" -#include "CGRecordLayoutBuilder.h" - using namespace clang; using namespace CodeGen; @@ -401,7 +398,6 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { /// ConvertTagDeclType - Lay out a tagged decl type like struct or union or /// enum. const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { - // TagDecl's are not necessarily unique, instead use the (clang) // type connected to the decl. const Type *Key = @@ -450,7 +446,7 @@ const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { } // Layout fields. - CGRecordLayout *Layout = CGRecordLayoutBuilder::ComputeLayout(*this, RD); + CGRecordLayout *Layout = ComputeRecordLayout(RD); CGRecordLayouts[Key] = Layout; const llvm::Type *ResultType = Layout->getLLVMType(); @@ -496,9 +492,7 @@ void CodeGenTypes::addBitFieldInfo(const FieldDecl *FD, unsigned FieldNo, const CGRecordLayout & CodeGenTypes::getCGRecordLayout(const RecordDecl *TD) const { const Type *Key = Context.getTagDeclType(TD).getTypePtr(); - llvm::DenseMap<const Type*, CGRecordLayout *>::const_iterator I - = CGRecordLayouts.find(Key); - assert (I != CGRecordLayouts.end() - && "Unable to find record layout information for type"); - return *I->second; + const CGRecordLayout *Layout = CGRecordLayouts.lookup(Key); + assert(Layout && "Unable to find record layout information for type"); + return *Layout; } |