[cfe-commits] r41438 - in /cfe/trunk/CodeGen: CGExpr.cpp CGExprScalar.cpp CodeGenFunction.h

Chris Lattner sabre at nondot.org
Sun Aug 26 00:16:41 PDT 2007


Author: lattner
Date: Sun Aug 26 02:16:41 2007
New Revision: 41438

URL: http://llvm.org/viewvc/llvm-project?rev=41438&view=rev
Log:
Omit EmitConversion


Modified:
    cfe/trunk/CodeGen/CGExpr.cpp
    cfe/trunk/CodeGen/CGExprScalar.cpp
    cfe/trunk/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExpr.cpp?rev=41438&r1=41437&r2=41438&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExpr.cpp Sun Aug 26 02:16:41 2007
@@ -44,27 +44,6 @@
 //                               Conversions
 //===--------------------------------------------------------------------===//
 
-/// EmitConversion - Convert the value specied by Val, whose type is ValTy, to
-/// the type specified by DstTy, following the rules of C99 6.3.
-RValue CodeGenFunction::EmitConversion(RValue Val, QualType ValTy,
-                                       QualType DstTy) {
-  ValTy = ValTy.getCanonicalType();
-  DstTy = DstTy.getCanonicalType();
-  if (ValTy == DstTy) return Val;
-
-  // Handle conversions to bool first, they are special: comparisons against 0.
-  if (const BuiltinType *DestBT = dyn_cast<BuiltinType>(DstTy))
-    if (DestBT->getKind() == BuiltinType::Bool)
-      return RValue::get(ConvertScalarValueToBool(Val, ValTy));
-  
-  if (Val.isScalar() && !hasAggregateLLVMType(DstTy))
-    return RValue::get(EmitScalarConversion(Val.getVal(), ValTy, DstTy));
-  
-  
-  assert(0 && "FIXME: We don't support complex conversions yet!");
-}
-
-
 /// ConvertScalarValueToBool - Convert the specified expression value to a
 /// boolean (i1) truth value.  This is equivalent to "Val == 0".
 llvm::Value *CodeGenFunction::ConvertScalarValueToBool(RValue Val, QualType Ty){

Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=41438&r1=41437&r2=41438&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Sun Aug 26 02:16:41 2007
@@ -378,10 +378,8 @@
   
   // If the destination is void, just evaluate the source.
   if (DestTy->isVoidType()) return 0;
-  
-  // FIXME: Refactor EmitConversion to not return an RValue.  Sink it into this
-  // method.
-  return CGF.EmitConversion(Src, E->getType(), DestTy).getVal();
+
+  assert(0 && "Can't convert from an aggregate yet!");
 }
 
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenFunction.h?rev=41438&r1=41437&r2=41438&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.h Sun Aug 26 02:16:41 2007
@@ -253,10 +253,6 @@
   //                                Conversions
   //===--------------------------------------------------------------------===//
   
-  /// EmitConversion - Convert the value specied by Val, whose type is ValTy, to
-  /// the type specified by DstTy, following the rules of C99 6.3.
-  RValue EmitConversion(RValue Val, QualType ValTy, QualType DstTy);
-  
   /// ConvertScalarValueToBool - Convert the specified expression value to a
   /// boolean (i1) truth value.  This is equivalent to "Val == 0".
   llvm::Value *ConvertScalarValueToBool(RValue Val, QualType Ty);





More information about the cfe-commits mailing list