//===--- CGExprAgg.cpp - Emit LLVM Code from Aggregate Expressions --------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This contains code to emit Aggregate Expr nodes as LLVM code.////===----------------------------------------------------------------------===//#include"CodeGenFunction.h"#include"CGObjCRuntime.h"#include"CodeGenModule.h"#include"clang/AST/ASTContext.h"#include"clang/AST/DeclCXX.h"#include"clang/AST/DeclTemplate.h"#include"clang/AST/StmtVisitor.h"#include"llvm/IR/Constants.h"#include"llvm/IR/Function.h"#include"llvm/IR/GlobalVariable.h"#include"llvm/IR/Intrinsics.h"usingnamespaceclang;usingnamespaceCodeGen;//===----------------------------------------------------------------------===//// Aggregate Expression Emitter//===----------------------------------------------------------------------===//namespace{classAggExprEmitter:publicStmtVisitor<AggExprEmitter>{CodeGenFunction&CGF;CGBuilderTy&Builder;AggValueSlotDest;/// We want to use 'dest' as the return slot except under two/// conditions:/// - The destination slot requires garbage collection, so we/// need to use the GC API./// - The destination slot is potentially aliased.boolshouldUseDestForReturnSlot()const{return!(Dest.requiresGCollection()||Dest.isPotentiallyAliased());}ReturnValueSlotgetReturnValueSlot()const{if(!shouldUseDestForReturnSlot())returnReturnValueSlot();returnReturnValueSlot(Dest.getAddr(),Dest.isVolatile());}AggValueSlotEnsureSlot(QualTypeT){if(!Dest.isIgnored())returnDest;returnCGF.CreateAggTemp(T,"agg.tmp.ensured"