[cfe-commits] r59435 - /cfe/trunk/lib/CodeGen/CGExprConstant.cpp

Eli Friedman eli.friedman at gmail.com
Sun Nov 16 19:57:28 PST 2008


Author: efriedma
Date: Sun Nov 16 21:57:28 2008
New Revision: 59435

URL: http://llvm.org/viewvc/llvm-project?rev=59435&view=rev
Log:
A few corrections to the expr constant work. Not enabled at the 
moment.


Modified:
    cfe/trunk/lib/CodeGen/CGExprConstant.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=59435&r1=59434&r2=59435&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sun Nov 16 21:57:28 2008
@@ -859,7 +859,7 @@
 
         const llvm::Type *Type = 
           llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
-        const llvm::Type *DestType = C->getType();
+        const llvm::Type *DestType = getTypes().ConvertTypeForMem(E->getType());
         
         // FIXME: It's a little ugly that we need to cast to a pointer,
         // apply the GEP and then cast back.
@@ -872,7 +872,7 @@
       return llvm::ConstantExpr::getIntToPtr(Offset, 
                                              getTypes().ConvertType(type));
     }
-    case APValue::Int:
+    case APValue::Int: {
       llvm::Constant *C = llvm::ConstantInt::get(V.getInt());
       
       if (C->getType() == llvm::Type::Int1Ty) {
@@ -880,6 +880,7 @@
         C = llvm::ConstantExpr::getZExt(C, BoolTy);
       }
       return C;
+    }
     case APValue::Float:
       return llvm::ConstantFP::get(V.getFloat());
     case APValue::ComplexFloat: {





More information about the cfe-commits mailing list