diff options
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 68b357ba580..1339c06646c 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -47,7 +47,7 @@ class ConstStructBuilder { public: static llvm::Constant *BuildStruct(ConstantEmitter &Emitter, ConstExprEmitter *ExprEmitter, - llvm::ConstantStruct *Base, + llvm::Constant *Base, InitListExpr *Updater, QualType ValTy); static llvm::Constant *BuildStruct(ConstantEmitter &Emitter, @@ -76,7 +76,7 @@ private: void ConvertStructToPacked(); bool Build(InitListExpr *ILE); - bool Build(ConstExprEmitter *Emitter, llvm::ConstantStruct *Base, + bool Build(ConstExprEmitter *Emitter, llvm::Constant *Base, InitListExpr *Updater); bool Build(const APValue &Val, const RecordDecl *RD, bool IsPrimaryBase, const CXXRecordDecl *VTableClass, CharUnits BaseOffset); @@ -566,7 +566,7 @@ llvm::Constant *ConstStructBuilder::Finalize(QualType Ty) { llvm::Constant *ConstStructBuilder::BuildStruct(ConstantEmitter &Emitter, ConstExprEmitter *ExprEmitter, - llvm::ConstantStruct *Base, + llvm::Constant *Base, InitListExpr *Updater, QualType ValTy) { ConstStructBuilder Builder(Emitter); @@ -1027,8 +1027,8 @@ public: } if (destType->isRecordType()) - return ConstStructBuilder::BuildStruct(Emitter, this, - dyn_cast<llvm::ConstantStruct>(Base), Updater, destType); + return ConstStructBuilder::BuildStruct(Emitter, this, Base, Updater, + destType); return nullptr; } @@ -1103,7 +1103,7 @@ public: } // end anonymous namespace. bool ConstStructBuilder::Build(ConstExprEmitter *ExprEmitter, - llvm::ConstantStruct *Base, + llvm::Constant *Base, InitListExpr *Updater) { assert(Base && "base expression should not be empty"); @@ -1111,7 +1111,7 @@ bool ConstStructBuilder::Build(ConstExprEmitter *ExprEmitter, RecordDecl *RD = ExprType->getAs<RecordType>()->getDecl(); const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); const llvm::StructLayout *BaseLayout = CGM.getDataLayout().getStructLayout( - Base->getType()); + cast<llvm::StructType>(Base->getType())); unsigned FieldNo = -1; unsigned ElementNo = 0; @@ -1132,7 +1132,7 @@ bool ConstStructBuilder::Build(ConstExprEmitter *ExprEmitter, if (Field->isUnnamedBitfield()) continue; - llvm::Constant *EltInit = Base->getOperand(ElementNo); + llvm::Constant *EltInit = Base->getAggregateElement(ElementNo); // Bail out if the type of the ConstantStruct does not have the same layout // as the type of the InitListExpr. |