diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-05 06:55:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-05 06:55:31 +0000 |
commit | af31913e48c96fddb45a0fd33f25617546502cbb (patch) | |
tree | fec6fbce36a560ee4c3ed214985e2473eb18a26d /CodeGen/CGExprConstant.cpp | |
parent | c4b23a530b04ee77b56772a70191d32119eadc3e (diff) |
Change the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
Type*'s can change as types are refined, so we can't use them as a stable key in
the map. Decls don't change, so use them instead.
This patch was written by Anders, but he's too shy to commit it himself :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CGExprConstant.cpp')
-rw-r--r-- | CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CodeGen/CGExprConstant.cpp b/CodeGen/CGExprConstant.cpp index fbf65aa59b..f72994d508 100644 --- a/CodeGen/CGExprConstant.cpp +++ b/CodeGen/CGExprConstant.cpp @@ -104,8 +104,9 @@ public: llvm::Constant *EmitStructInitialization(InitListExpr *ILE, const llvm::StructType *SType) { + TagDecl *TD = ILE->getType()->getAsRecordType()->getDecl(); std::vector<llvm::Constant*> Elts; - const CGRecordLayout *CGR = CGM.getTypes().getCGRecordLayout(SType); + const CGRecordLayout *CGR = CGM.getTypes().getCGRecordLayout(TD); unsigned NumInitElements = ILE->getNumInits(); unsigned NumElements = SType->getNumElements(); |