[cfe-commits] r41350 - in /cfe/trunk: CodeGen/CGAggExpr.cpp CodeGen/CGComplexExpr.cpp CodeGen/CGExprAgg.cpp CodeGen/CGExprComplex.cpp clang.xcodeproj/project.pbxproj

Chris Lattner sabre at nondot.org
Thu Aug 23 19:22:54 PDT 2007


Author: lattner
Date: Thu Aug 23 21:22:53 2007
New Revision: 41350

URL: http://llvm.org/viewvc/llvm-project?rev=41350&view=rev
Log:
rename two files.

Added:
    cfe/trunk/CodeGen/CGExprAgg.cpp
      - copied, changed from r41349, cfe/trunk/CodeGen/CGAggExpr.cpp
    cfe/trunk/CodeGen/CGExprComplex.cpp
      - copied, changed from r41349, cfe/trunk/CodeGen/CGComplexExpr.cpp
Removed:
    cfe/trunk/CodeGen/CGAggExpr.cpp
    cfe/trunk/CodeGen/CGComplexExpr.cpp
Modified:
    cfe/trunk/clang.xcodeproj/project.pbxproj

Removed: cfe/trunk/CodeGen/CGAggExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGAggExpr.cpp?rev=41349&view=auto

==============================================================================
--- cfe/trunk/CodeGen/CGAggExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGAggExpr.cpp (removed)
@@ -1,186 +0,0 @@
-//===--- CGAggExpr.cpp - Emit LLVM Code from Aggregate Expressions --------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file was developed by Chris Lattner and 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 "CodeGenModule.h"
-#include "clang/AST/AST.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Compiler.h"
-using namespace clang;
-using namespace CodeGen;
-
-//===----------------------------------------------------------------------===//
-//                        Aggregate Expression Emitter
-//===----------------------------------------------------------------------===//
-
-namespace  {
-class VISIBILITY_HIDDEN AggExprEmitter : public StmtVisitor<AggExprEmitter> {
-  CodeGenFunction &CGF;
-  llvm::Value *DestPtr;
-  bool VolatileDest;
-public:
-  AggExprEmitter(CodeGenFunction &cgf, llvm::Value *destPtr, bool volatileDest)
-    : CGF(cgf), DestPtr(destPtr), VolatileDest(volatileDest) {
-  }
-
-  //===--------------------------------------------------------------------===//
-  //                               Utilities
-  //===--------------------------------------------------------------------===//
-
-  /// EmitAggLoadOfLValue - Given an expression with aggregate type that
-  /// represents a value lvalue, this method emits the address of the lvalue,
-  /// then loads the result into DestPtr.
-  void EmitAggLoadOfLValue(const Expr *E);
-  
-  
-  //===--------------------------------------------------------------------===//
-  //                            Visitor Methods
-  //===--------------------------------------------------------------------===//
-  
-  void VisitStmt(Stmt *S) {
-    fprintf(stderr, "Unimplemented agg expr!\n");
-    S->dump();
-  }
-  void VisitParenExpr(ParenExpr *PE) { Visit(PE->getSubExpr()); }
-
-  // l-values.
-  void VisitDeclRefExpr(DeclRefExpr *DRE) { return EmitAggLoadOfLValue(DRE); }
-  //  case Expr::ArraySubscriptExprClass:
-
-  // Operators.
-  //  case Expr::UnaryOperatorClass:
-  //  case Expr::ImplicitCastExprClass:
-  //  case Expr::CastExprClass: 
-  //  case Expr::CallExprClass:
-  void VisitBinaryOperator(const BinaryOperator *BO);
-  void VisitBinAssign(const BinaryOperator *E);
-
-  
-  void VisitConditionalOperator(const ConditionalOperator *CO);
-  //  case Expr::ChooseExprClass:
-};
-}  // end anonymous namespace.
-
-//===----------------------------------------------------------------------===//
-//                                Utilities
-//===----------------------------------------------------------------------===//
-
-/// EmitAggLoadOfLValue - Given an expression with aggregate type that
-/// represents a value lvalue, this method emits the address of the lvalue,
-/// then loads the result into DestPtr.
-void AggExprEmitter::EmitAggLoadOfLValue(const Expr *E) {
-  LValue LV = CGF.EmitLValue(E);
-  assert(LV.isSimple() && "Can't have aggregate bitfield, vector, etc");
-  llvm::Value *SrcPtr = LV.getAddress();
-  
-  // If the result is ignored, don't copy from the value.
-  if (DestPtr == 0)
-    // FIXME: If the source is volatile, we must read from it.
-    return;
-
-  CGF.EmitAggregateCopy(DestPtr, SrcPtr, E->getType());
-}
-
-//===----------------------------------------------------------------------===//
-//                            Visitor Methods
-//===----------------------------------------------------------------------===//
-
-void AggExprEmitter::VisitBinaryOperator(const BinaryOperator *E) {
-  fprintf(stderr, "Unimplemented aggregate binary expr!\n");
-  E->dump();
-}
-
-void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
-  assert(E->getLHS()->getType().getCanonicalType() ==
-         E->getRHS()->getType().getCanonicalType() && "Invalid assignment");
-  LValue LHS = CGF.EmitLValue(E->getLHS());
-
-  // Codegen the RHS so that it stores directly into the LHS.
-  CGF.EmitAggExpr(E->getRHS(), LHS.getAddress(), false /*FIXME: VOLATILE LHS*/);
-
-  // If the result of the assignment is used, copy the RHS there also.
-  if (DestPtr) {
-    assert(0 && "FIXME: Chained agg assignment not implemented yet");
-  }
-}
-
-void AggExprEmitter::VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::BasicBlock *LHSBlock = new llvm::BasicBlock("cond.?");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("cond.:");
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("cond.cont");
-  
-  llvm::Value *Cond = CGF.EvaluateExprAsBool(E->getCond());
-  CGF.Builder.CreateCondBr(Cond, LHSBlock, RHSBlock);
-  
-  CGF.EmitBlock(LHSBlock);
-  
-  // Handle the GNU extension for missing LHS.
-  assert(E->getLHS() && "Must have LHS for aggregate value");
-
-  Visit(E->getLHS());
-  CGF.Builder.CreateBr(ContBlock);
-  LHSBlock = CGF.Builder.GetInsertBlock();
-  
-  CGF.EmitBlock(RHSBlock);
-  
-  Visit(E->getRHS());
-  CGF.Builder.CreateBr(ContBlock);
-  RHSBlock = CGF.Builder.GetInsertBlock();
-  
-  CGF.EmitBlock(ContBlock);
-}
-
-//===----------------------------------------------------------------------===//
-//                        Entry Points into this File
-//===----------------------------------------------------------------------===//
-
-/// EmitAggExpr - Emit the computation of the specified expression of
-/// aggregate type.  The result is computed into DestPtr.  Note that if
-/// DestPtr is null, the value of the aggregate expression is not needed.
-void CodeGenFunction::EmitAggExpr(const Expr *E, llvm::Value *DestPtr,
-                                  bool VolatileDest) {
-  assert(E && hasAggregateLLVMType(E->getType()) &&
-         "Invalid aggregate expression to emit");
-  
-  AggExprEmitter(*this, DestPtr, VolatileDest).Visit(const_cast<Expr*>(E));
-}
-
-
-// FIXME: Handle volatility!
-void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
-                                        llvm::Value *SrcPtr, QualType Ty) {
-  assert(!Ty->isComplexType() && "Shouldn't happen for complex");
-  
-  // Aggregate assignment turns into llvm.memcpy.
-  const llvm::Type *BP = llvm::PointerType::get(llvm::Type::Int8Ty);
-  if (DestPtr->getType() != BP)
-    DestPtr = Builder.CreateBitCast(DestPtr, BP, "tmp");
-  if (SrcPtr->getType() != BP)
-    SrcPtr = Builder.CreateBitCast(SrcPtr, BP, "tmp");
-  
-  // Get size and alignment info for this aggregate.
-  std::pair<uint64_t, unsigned> TypeInfo =
-    getContext().getTypeInfo(Ty, SourceLocation());
-  
-  // FIXME: Handle variable sized types.
-  const llvm::Type *IntPtr = llvm::IntegerType::get(LLVMPointerWidth);
-  
-  llvm::Value *MemCpyOps[4] = {
-    DestPtr, SrcPtr,
-    llvm::ConstantInt::get(IntPtr, TypeInfo.first),
-    llvm::ConstantInt::get(llvm::Type::Int32Ty, TypeInfo.second)
-  };
-  
-  Builder.CreateCall(CGM.getMemCpyFn(), MemCpyOps, MemCpyOps+4);
-}

Removed: cfe/trunk/CodeGen/CGComplexExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGComplexExpr.cpp?rev=41349&view=auto

==============================================================================
--- cfe/trunk/CodeGen/CGComplexExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGComplexExpr.cpp (removed)
@@ -1,348 +0,0 @@
-//===--- CGComplexExpr.cpp - Emit LLVM Code for Complex Exprs -------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file was developed by Chris Lattner and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This contains code to emit Expr nodes with complex types as LLVM code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeGenFunction.h"
-#include "CodeGenModule.h"
-#include "clang/AST/AST.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Compiler.h"
-using namespace clang;
-using namespace CodeGen;
-
-//===----------------------------------------------------------------------===//
-//                        Complex Expression Emitter
-//===----------------------------------------------------------------------===//
-
-typedef CodeGenFunction::ComplexPairTy ComplexPairTy;
-
-namespace  {
-class VISIBILITY_HIDDEN ComplexExprEmitter
-  : public StmtVisitor<ComplexExprEmitter, ComplexPairTy> {
-  CodeGenFunction &CGF;
-  llvm::LLVMBuilder &Builder;
-public:
-  ComplexExprEmitter(CodeGenFunction &cgf) : CGF(cgf), Builder(CGF.Builder) {
-  }
-
-  
-  //===--------------------------------------------------------------------===//
-  //                               Utilities
-  //===--------------------------------------------------------------------===//
-
-  /// EmitLoadOfLValue - Given an expression with complex type that represents a
-  /// value l-value, this method emits the address of the l-value, then loads
-  /// and returns the result.
-  ComplexPairTy EmitLoadOfLValue(const Expr *E) {
-    LValue LV = CGF.EmitLValue(E);
-    // FIXME: Volatile
-    return EmitLoadOfComplex(LV.getAddress(), false);
-  }
-  
-  /// EmitLoadOfComplex - Given a pointer to a complex value, emit code to load
-  /// the real and imaginary pieces.
-  ComplexPairTy EmitLoadOfComplex(llvm::Value *SrcPtr, bool isVolatile);
-  
-  /// EmitStoreOfComplex - Store the specified real/imag parts into the
-  /// specified value pointer.
-  void EmitStoreOfComplex(ComplexPairTy Val, llvm::Value *ResPtr, bool isVol);
-  
-  //===--------------------------------------------------------------------===//
-  //                            Visitor Methods
-  //===--------------------------------------------------------------------===//
-
-  ComplexPairTy VisitStmt(Stmt *S) {
-    S->dump();
-    assert(0 && "Stmt can't have complex result type!");
-    return ComplexPairTy();
-  }
-  ComplexPairTy VisitExpr(Expr *S);
-  ComplexPairTy VisitParenExpr(ParenExpr *PE) { return Visit(PE->getSubExpr());}
-
-  // l-values.
-  ComplexPairTy VisitDeclRefExpr(Expr *E) { return EmitLoadOfLValue(E); }
-  ComplexPairTy VisitArraySubscriptExpr(Expr *E) { return EmitLoadOfLValue(E); }
-  ComplexPairTy VisitMemberExpr(Expr *E) { return EmitLoadOfLValue(E); }
-
-  // FIXME: CompoundLiteralExpr
-  // FIXME: ImplicitCastExpr
-  ComplexPairTy VisitCallExpr(const CallExpr *E);
-  
-  // Operators.
-  ComplexPairTy VisitPrePostIncDec(const UnaryOperator *E,
-                                   bool isInc, bool isPre);
-  ComplexPairTy VisitUnaryPostDec(const UnaryOperator *E) {
-    return VisitPrePostIncDec(E, false, false);
-  }
-  ComplexPairTy VisitUnaryPostInc(const UnaryOperator *E) {
-    return VisitPrePostIncDec(E, true, false);
-  }
-  ComplexPairTy VisitUnaryPreDec(const UnaryOperator *E) {
-    return VisitPrePostIncDec(E, false, true);
-  }
-  ComplexPairTy VisitUnaryPreInc(const UnaryOperator *E) {
-    return VisitPrePostIncDec(E, true, true);
-  }
-  ComplexPairTy VisitUnaryDeref(const Expr *E) { return EmitLoadOfLValue(E); }
-  ComplexPairTy VisitUnaryPlus     (const UnaryOperator *E) {
-    return Visit(E->getSubExpr());
-  }
-  ComplexPairTy VisitUnaryMinus    (const UnaryOperator *E);
-  ComplexPairTy VisitUnaryNot      (const UnaryOperator *E);
-  // LNot,SizeOf,AlignOf,Real,Imag never return complex.
-  ComplexPairTy VisitUnaryExtension(const UnaryOperator *E) {
-    return Visit(E->getSubExpr());
-  }
-  
-  ComplexPairTy VisitBinMul        (const BinaryOperator *E);
-  ComplexPairTy VisitBinAdd        (const BinaryOperator *E);
-  ComplexPairTy VisitBinSub        (const BinaryOperator *E);
-  // FIXME: div/rem
-  // GCC rejects and/or/xor for integer complex.
-  // Logical and/or always return int, never complex.
-
-  // No comparisons produce a complex result.
-  ComplexPairTy VisitBinAssign     (const BinaryOperator *E);
-  // FIXME: Compound assignment operators.
-  ComplexPairTy VisitBinComma      (const BinaryOperator *E);
-
-  
-  ComplexPairTy VisitConditionalOperator(const ConditionalOperator *CO);
-  ComplexPairTy VisitChooseExpr(ChooseExpr *CE);
-  //  case Expr::ChooseExprClass:
-};
-}  // end anonymous namespace.
-
-//===----------------------------------------------------------------------===//
-//                                Utilities
-//===----------------------------------------------------------------------===//
-
-/// EmitLoadOfComplex - Given an RValue reference for a complex, emit code to
-/// load the real and imaginary pieces, returning them as Real/Imag.
-ComplexPairTy ComplexExprEmitter::EmitLoadOfComplex(llvm::Value *SrcPtr,
-                                                    bool isVolatile) {
-  llvm::Constant *Zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
-  llvm::Constant *One  = llvm::ConstantInt::get(llvm::Type::Int32Ty, 1);
-  // FIXME: It would be nice to make this "Ptr->getName()+realp"
-  llvm::Value *RealPtr = Builder.CreateGEP(SrcPtr, Zero, Zero, "realp");
-  llvm::Value *ImagPtr = Builder.CreateGEP(SrcPtr, Zero, One, "imagp");
-  
-  // FIXME: It would be nice to make this "Ptr->getName()+real"
-  llvm::Value *Real = Builder.CreateLoad(RealPtr, isVolatile, "real");
-  llvm::Value *Imag = Builder.CreateLoad(ImagPtr, isVolatile, "imag");
-  return ComplexPairTy(Real, Imag);
-}
-
-/// EmitStoreOfComplex - Store the specified real/imag parts into the
-/// specified value pointer.
-void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, llvm::Value *Ptr,
-                                            bool isVolatile) {
-  llvm::Constant *Zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
-  llvm::Constant *One  = llvm::ConstantInt::get(llvm::Type::Int32Ty, 1);
-  llvm::Value *RealPtr = Builder.CreateGEP(Ptr, Zero, Zero, "real");
-  llvm::Value *ImagPtr = Builder.CreateGEP(Ptr, Zero, One, "imag");
-  
-  Builder.CreateStore(Val.first, RealPtr, isVolatile);
-  Builder.CreateStore(Val.second, ImagPtr, isVolatile);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-//                            Visitor Methods
-//===----------------------------------------------------------------------===//
-
-ComplexPairTy ComplexExprEmitter::VisitExpr(Expr *E) {
-  fprintf(stderr, "Unimplemented complex expr!\n");
-  E->dump();
-  const llvm::Type *EltTy = 
-    CGF.ConvertType(E->getType()->getAsComplexType()->getElementType());
-  llvm::Value *U = llvm::UndefValue::get(EltTy);
-  return ComplexPairTy(U, U);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) {
-  llvm::Value *AggPtr = CGF.EmitCallExpr(E).getAggregateAddr();
-  return EmitLoadOfComplex(AggPtr, false);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
-                                                     bool isInc, bool isPre) {
-  LValue LV = CGF.EmitLValue(E->getSubExpr());
-  // FIXME: Handle volatile!
-  ComplexPairTy InVal = EmitLoadOfComplex(LV.getAddress(), false);
-  
-  int AmountVal = isInc ? 1 : -1;
-  
-  llvm::Value *NextVal;
-  if (isa<llvm::IntegerType>(InVal.first->getType()))
-    NextVal = llvm::ConstantInt::get(InVal.first->getType(), AmountVal);
-  else
-    NextVal = llvm::ConstantFP::get(InVal.first->getType(), AmountVal);
-  
-  // Add the inc/dec to the real part.
-  NextVal = Builder.CreateAdd(InVal.first, NextVal, isInc ? "inc" : "dec");
-  
-  ComplexPairTy IncVal(NextVal, InVal.second);
-  
-  // Store the updated result through the lvalue.
-  EmitStoreOfComplex(IncVal, LV.getAddress(), false);  /* FIXME: Volatile */
-  
-  // If this is a postinc, return the value read from memory, otherwise use the
-  // updated value.
-  return isPre ? IncVal : InVal;
-}
-
-ComplexPairTy ComplexExprEmitter::VisitUnaryMinus(const UnaryOperator *E) {
-  ComplexPairTy Op = Visit(E->getSubExpr());
-  llvm::Value *ResR = Builder.CreateNeg(Op.first,  "neg.r");
-  llvm::Value *ResI = Builder.CreateNeg(Op.second, "neg.i");
-  return ComplexPairTy(ResR, ResI);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitUnaryNot(const UnaryOperator *E) {
-  // ~(a+ib) = a + i*-b
-  ComplexPairTy Op = Visit(E->getSubExpr());
-  llvm::Value *ResI = Builder.CreateNeg(Op.second, "conj.i");
-  return ComplexPairTy(Op.first, ResI);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitBinAdd(const BinaryOperator *E) {
-  ComplexPairTy LHS = Visit(E->getLHS());
-  ComplexPairTy RHS = Visit(E->getRHS());
-  
-  llvm::Value *ResR = Builder.CreateAdd(LHS.first,  RHS.first,  "add.r");
-  llvm::Value *ResI = Builder.CreateAdd(LHS.second, RHS.second, "add.i");
-
-  return ComplexPairTy(ResR, ResI);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitBinSub(const BinaryOperator *E) {
-  ComplexPairTy LHS = Visit(E->getLHS());
-  ComplexPairTy RHS = Visit(E->getRHS());
-  
-  llvm::Value *ResR = Builder.CreateSub(LHS.first,  RHS.first,  "sub.r");
-  llvm::Value *ResI = Builder.CreateSub(LHS.second, RHS.second, "sub.i");
-  
-  return ComplexPairTy(ResR, ResI);
-}
-
-
-ComplexPairTy ComplexExprEmitter::VisitBinMul(const BinaryOperator *E) {
-  ComplexPairTy LHS = Visit(E->getLHS());
-  ComplexPairTy RHS = Visit(E->getRHS());
-  
-  llvm::Value *ResRl = Builder.CreateMul(LHS.first, RHS.first, "mul.rl");
-  llvm::Value *ResRr = Builder.CreateMul(LHS.second, RHS.second, "mul.rr");
-  llvm::Value *ResR  = Builder.CreateSub(ResRl, ResRr, "mul.r");
-  
-  llvm::Value *ResIl = Builder.CreateMul(LHS.second, RHS.first, "mul.il");
-  llvm::Value *ResIr = Builder.CreateMul(LHS.first, RHS.second, "mul.ir");
-  llvm::Value *ResI  = Builder.CreateAdd(ResIl, ResIr, "mul.i");
-
-  return ComplexPairTy(ResR, ResI);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) {
-  assert(E->getLHS()->getType().getCanonicalType() ==
-         E->getRHS()->getType().getCanonicalType() && "Invalid assignment");
-  // Emit the RHS.
-  ComplexPairTy Val = Visit(E->getRHS());
-
-  // Compute the address to store into.
-  LValue LHS = CGF.EmitLValue(E->getLHS());
-  
-  // Store into it.
-  // FIXME: Volatility!
-  EmitStoreOfComplex(Val, LHS.getAddress(), false);
-  return Val;
-}
-
-ComplexPairTy ComplexExprEmitter::VisitBinComma(const BinaryOperator *E) {
-  CGF.EmitStmt(E->getLHS());
-  return Visit(E->getRHS());
-}
-
-ComplexPairTy ComplexExprEmitter::
-VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::BasicBlock *LHSBlock = new llvm::BasicBlock("cond.?");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("cond.:");
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("cond.cont");
-  
-  llvm::Value *Cond = CGF.EvaluateExprAsBool(E->getCond());
-  Builder.CreateCondBr(Cond, LHSBlock, RHSBlock);
-  
-  CGF.EmitBlock(LHSBlock);
-  
-  // Handle the GNU extension for missing LHS.
-  assert(E->getLHS() && "Must have LHS for complex value");
-
-  ComplexPairTy LHS = Visit(E->getLHS());
-  Builder.CreateBr(ContBlock);
-  LHSBlock = Builder.GetInsertBlock();
-  
-  CGF.EmitBlock(RHSBlock);
-  
-  ComplexPairTy RHS = Visit(E->getRHS());
-  Builder.CreateBr(ContBlock);
-  RHSBlock = Builder.GetInsertBlock();
-  
-  CGF.EmitBlock(ContBlock);
-  
-  // Create a PHI node for the real part.
-  llvm::PHINode *RealPN = Builder.CreatePHI(LHS.first->getType(), "cond.r");
-  RealPN->reserveOperandSpace(2);
-  RealPN->addIncoming(LHS.first, LHSBlock);
-  RealPN->addIncoming(RHS.first, RHSBlock);
-
-  // Create a PHI node for the imaginary part.
-  llvm::PHINode *ImagPN = Builder.CreatePHI(LHS.first->getType(), "cond.i");
-  ImagPN->reserveOperandSpace(2);
-  ImagPN->addIncoming(LHS.second, LHSBlock);
-  ImagPN->addIncoming(RHS.second, RHSBlock);
-  
-  return ComplexPairTy(RealPN, ImagPN);
-}
-
-ComplexPairTy ComplexExprEmitter::VisitChooseExpr(ChooseExpr *E) {
-  llvm::APSInt CondVal(32);
-  bool IsConst = E->getCond()->isIntegerConstantExpr(CondVal, CGF.getContext());
-  assert(IsConst && "Condition of choose expr must be i-c-e"); IsConst=IsConst;
-  
-  // Emit the LHS or RHS as appropriate.
-  return Visit(CondVal != 0 ? E->getLHS() : E->getRHS());
-}
-
-//===----------------------------------------------------------------------===//
-//                         Entry Point into this File
-//===----------------------------------------------------------------------===//
-
-/// EmitComplexExpr - Emit the computation of the specified expression of
-/// complex type, ignoring the result.
-ComplexPairTy CodeGenFunction::EmitComplexExpr(const Expr *E) {
-  assert(E && E->getType()->isComplexType() &&
-         "Invalid complex expression to emit");
-  
-  return ComplexExprEmitter(*this).Visit(const_cast<Expr*>(E));
-}
-
-/// EmitComplexExprIntoAddr - Emit the computation of the specified expression
-/// of complex type, storing into the specified Value*.
-void CodeGenFunction::EmitComplexExprIntoAddr(const Expr *E,
-                                              llvm::Value *DestAddr) {
-  assert(E && E->getType()->isComplexType() &&
-         "Invalid complex expression to emit");
-  ComplexExprEmitter Emitter(*this);
-  ComplexPairTy Val = Emitter.Visit(const_cast<Expr*>(E));
-  Emitter.EmitStoreOfComplex(Val, DestAddr, false);
-}

Copied: cfe/trunk/CodeGen/CGExprAgg.cpp (from r41349, cfe/trunk/CodeGen/CGAggExpr.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprAgg.cpp?p2=cfe/trunk/CodeGen/CGExprAgg.cpp&p1=cfe/trunk/CodeGen/CGAggExpr.cpp&r1=41349&r2=41350&rev=41350&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGAggExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExprAgg.cpp Thu Aug 23 21:22:53 2007
@@ -1,4 +1,4 @@
-//===--- CGAggExpr.cpp - Emit LLVM Code from Aggregate Expressions --------===//
+//===--- CGExprAgg.cpp - Emit LLVM Code from Aggregate Expressions --------===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Copied: cfe/trunk/CodeGen/CGExprComplex.cpp (from r41349, cfe/trunk/CodeGen/CGComplexExpr.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprComplex.cpp?p2=cfe/trunk/CodeGen/CGExprComplex.cpp&p1=cfe/trunk/CodeGen/CGComplexExpr.cpp&r1=41349&r2=41350&rev=41350&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGComplexExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExprComplex.cpp Thu Aug 23 21:22:53 2007
@@ -1,4 +1,4 @@
-//===--- CGComplexExpr.cpp - Emit LLVM Code for Complex Exprs -------------===//
+//===--- CGExprComplex.cpp - Emit LLVM Code for Complex Exprs -------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=41350&r1=41349&r2=41350&view=diff

==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Thu Aug 23 21:22:53 2007
@@ -26,7 +26,7 @@
 		DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE17336D0B068DC20080B521 /* DeclSpec.cpp */; };
 		DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE17336F0B068DC60080B521 /* DeclSpec.h */; };
 		DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; };
-		DE224FF80C7AA98800D370A5 /* CGComplexExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE224FF70C7AA98800D370A5 /* CGComplexExpr.cpp */; };
+		DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */; };
 		DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */; };
 		DE344B540AE5E46C00DBC861 /* HeaderSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */; };
 		DE3450D70AEB543100DBC861 /* DirectoryLookup.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3450D60AEB543100DBC861 /* DirectoryLookup.h */; };
@@ -123,7 +123,7 @@
 		DEF2E9340C5FBA02000C4259 /* ASTStreamers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2E9330C5FBA02000C4259 /* ASTStreamers.cpp */; };
 		DEF2E95F0C5FBD74000C4259 /* InternalsManual.html in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */; };
 		DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */; };
-		DEF2EFF30C6CDD74000C4259 /* CGAggExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EFF20C6CDD74000C4259 /* CGAggExpr.cpp */; };
+		DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */; };
 		DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */; };
 		F0226FD20C18084500141F42 /* TextDiagnosticPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0226FD00C18084500141F42 /* TextDiagnosticPrinter.cpp */; };
 		F0226FD30C18084500141F42 /* TextDiagnosticPrinter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F0226FD10C18084500141F42 /* TextDiagnosticPrinter.h */; };
@@ -219,7 +219,7 @@
 		DE17336D0B068DC20080B521 /* DeclSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DeclSpec.cpp; path = Parse/DeclSpec.cpp; sourceTree = "<group>"; };
 		DE17336F0B068DC60080B521 /* DeclSpec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DeclSpec.h; path = clang/Parse/DeclSpec.h; sourceTree = "<group>"; };
 		DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = "<group>"; };
-		DE224FF70C7AA98800D370A5 /* CGComplexExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CGComplexExpr.cpp; path = CodeGen/CGComplexExpr.cpp; sourceTree = "<group>"; };
+		DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprComplex.cpp; path = CodeGen/CGExprComplex.cpp; sourceTree = "<group>"; };
 		DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderSearch.h; sourceTree = "<group>"; };
 		DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderSearch.cpp; sourceTree = "<group>"; };
 		DE3450D60AEB543100DBC861 /* DirectoryLookup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DirectoryLookup.h; sourceTree = "<group>"; };
@@ -316,7 +316,7 @@
 		DEF2E9330C5FBA02000C4259 /* ASTStreamers.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ASTStreamers.cpp; path = Driver/ASTStreamers.cpp; sourceTree = "<group>"; };
 		DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = InternalsManual.html; path = docs/InternalsManual.html; sourceTree = "<group>"; };
 		DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StmtDumper.cpp; path = AST/StmtDumper.cpp; sourceTree = "<group>"; };
-		DEF2EFF20C6CDD74000C4259 /* CGAggExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CGAggExpr.cpp; path = CodeGen/CGAggExpr.cpp; sourceTree = "<group>"; };
+		DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprAgg.cpp; path = CodeGen/CGExprAgg.cpp; sourceTree = "<group>"; };
 		DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SemaChecking.cpp; path = Sema/SemaChecking.cpp; sourceTree = "<group>"; };
 		F0226FD00C18084500141F42 /* TextDiagnosticPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticPrinter.cpp; path = Driver/TextDiagnosticPrinter.cpp; sourceTree = "<group>"; };
 		F0226FD10C18084500141F42 /* TextDiagnosticPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticPrinter.h; path = Driver/TextDiagnosticPrinter.h; sourceTree = "<group>"; };
@@ -441,9 +441,9 @@
 				DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */,
 				1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */,
 				DE4264FB0C113592005A861D /* CGDecl.cpp */,
-				DEF2EFF20C6CDD74000C4259 /* CGAggExpr.cpp */,
-				DE224FF70C7AA98800D370A5 /* CGComplexExpr.cpp */,
 				DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */,
+				DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */,
+				DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */,
 				1A7342470C7B57D500122F56 /* CGObjC.cpp */,
 				DE4772F90C10EAE5002239E8 /* CGStmt.cpp */,
 				DE928B120C05659200231DA4 /* ModuleBuilder.cpp */,
@@ -698,10 +698,10 @@
 				DEEBCBE50C33703100A9FE82 /* TextDiagnosticBuffer.cpp in Sources */,
 				DEF2E9340C5FBA02000C4259 /* ASTStreamers.cpp in Sources */,
 				DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */,
-				DEF2EFF30C6CDD74000C4259 /* CGAggExpr.cpp in Sources */,
+				DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */,
 				DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */,
 				1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */,
-				DE224FF80C7AA98800D370A5 /* CGComplexExpr.cpp in Sources */,
+				DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */,
 				1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */,
 				DEC63B1A0C7B940200DBF169 /* CFG.cpp in Sources */,
 			);





More information about the cfe-commits mailing list