]> granicus.if.org Git - clang/commitdiff
Omit EmitConversion
authorChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 07:16:41 +0000 (07:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 07:16:41 +0000 (07:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41438 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGExpr.cpp
CodeGen/CGExprScalar.cpp
CodeGen/CodeGenFunction.h

index 776ec78b5196411ba8247fac0b474f7b7c32e71f..58b4059aebe6795447b597c361fd28c28df8cb65 100644 (file)
@@ -44,27 +44,6 @@ llvm::Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) {
 //                               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){
index b1f26d61bea999aa3e3c1d1356fa29c9d20a6915..deaf0a89fe2fda9ab23a3eb0439b6d462b001909 100644 (file)
@@ -378,10 +378,8 @@ Value *ScalarExprEmitter::EmitCastExpr(const Expr *E, QualType DestTy) {
   
   // 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!");
 }
 
 //===----------------------------------------------------------------------===//
index 71573df6799bb5e71473556fae76af7b5f501c64..29b193890b51f47ad365f301474736b41759b01c 100644 (file)
@@ -253,10 +253,6 @@ public:
   //                                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);