[cfe-commits] r45081 - in /cfe/trunk/CodeGen: CGBuiltin.cpp CGExpr.cpp CGExprAgg.cpp CodeGenModule.cpp CodeGenTypes.cpp
Christopher Lamb
christopher.lamb at gmail.com
Sun Dec 16 17:11:20 PST 2007
Author: clamb
Date: Sun Dec 16 19:11:20 2007
New Revision: 45081
URL: http://llvm.org/viewvc/llvm-project?rev=45081&view=rev
Log:
Update to use new PointerType::getUnqual() api.
Modified:
cfe/trunk/CodeGen/CGBuiltin.cpp
cfe/trunk/CodeGen/CGExpr.cpp
cfe/trunk/CodeGen/CGExprAgg.cpp
cfe/trunk/CodeGen/CodeGenModule.cpp
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGBuiltin.cpp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/CodeGen/CGBuiltin.cpp Sun Dec 16 19:11:20 2007
@@ -113,7 +113,8 @@
case Builtin::BI__builtin_va_start:
case Builtin::BI__builtin_va_end: {
Value *ArgValue = EmitScalarExpr(E->getArg(0));
- const llvm::Type *DestType = llvm::PointerType::get(llvm::Type::Int8Ty);
+ const llvm::Type *DestType =
+ llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
if (ArgValue->getType() != DestType)
ArgValue = Builder.CreateBitCast(ArgValue, DestType,
ArgValue->getNameStart());
Modified: cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExpr.cpp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExpr.cpp Sun Dec 16 19:11:20 2007
@@ -83,7 +83,7 @@
switch (E->getStmtClass()) {
default: {
WarnUnsupported(E, "l-value expression");
- llvm::Type *Ty = llvm::PointerType::get(ConvertType(E->getType()));
+ llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));
return LValue::MakeAddr(llvm::UndefValue::get(Ty));
}
@@ -220,11 +220,13 @@
assert(Src.isScalar() && "Can't emit an agg store with this method");
// FIXME: Handle volatility etc.
const llvm::Type *SrcTy = Src.getScalarVal()->getType();
- const llvm::Type *AddrTy =
- cast<llvm::PointerType>(DstAddr->getType())->getElementType();
+ const llvm::PointerType *DstPtr = cast<llvm::PointerType>(DstAddr->getType());
+ const llvm::Type *AddrTy = DstPtr->getElementType();
+ unsigned AS = DstPtr->getAddressSpace();
if (AddrTy != SrcTy)
- DstAddr = Builder.CreateBitCast(DstAddr, llvm::PointerType::get(SrcTy),
+ DstAddr = Builder.CreateBitCast(DstAddr,
+ llvm::PointerType::get(SrcTy, AS),
"storetmp");
Builder.CreateStore(Src.getScalarVal(), DstAddr);
}
@@ -422,7 +424,10 @@
const llvm::PointerType * BaseTy =
cast<llvm::PointerType>(BaseValue->getType());
if (FieldTy != BaseTy->getElementType()) {
- V = Builder.CreateBitCast(V, llvm::PointerType::get(FieldTy), "tmp");
+ // FIXME: Need to get address space qualification of pointer
+ V = Builder.CreateBitCast(V,
+ llvm::PointerType::getUnqual(FieldTy),
+ "tmp");
}
}
return LValue::MakeAddr(V);
Modified: cfe/trunk/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprAgg.cpp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/CodeGen/CGExprAgg.cpp Sun Dec 16 19:11:20 2007
@@ -92,7 +92,7 @@
assert(!Ty->isComplexType() && "Shouldn't happen for complex");
// Aggregate assignment turns into llvm.memcpy.
- const llvm::Type *BP = llvm::PointerType::get(llvm::Type::Int8Ty);
+ const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
if (DestPtr->getType() != BP)
DestPtr = Builder.CreateBitCast(DestPtr, BP, "tmp");
if (SrcPtr->getType() != BP)
Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Sun Dec 16 19:11:20 2007
@@ -75,7 +75,7 @@
}
// If the pointer type matches, just return it.
- llvm::Type *PFTy = llvm::PointerType::get(Ty);
+ llvm::Type *PFTy = llvm::PointerType::getUnqual(Ty);
if (PFTy == F->getType()) return Entry = F;
// If this isn't a definition, just return it casted to the right type.
@@ -132,7 +132,7 @@
}
// If the pointer type matches, just return it.
- llvm::Type *PTy = llvm::PointerType::get(Ty);
+ llvm::Type *PTy = llvm::PointerType::getUnqual(Ty);
if (PTy == GV->getType()) return Entry = GV;
// If this isn't a definition, just return it casted to the right type.
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Sun Dec 16 19:11:20 2007
@@ -178,11 +178,11 @@
}
case Type::Pointer: {
const PointerType &P = cast<PointerType>(Ty);
- return llvm::PointerType::get(ConvertType(P.getPointeeType()));
+ return llvm::PointerType::getUnqual(ConvertType(P.getPointeeType()));
}
case Type::Reference: {
const ReferenceType &R = cast<ReferenceType>(Ty);
- return llvm::PointerType::get(ConvertType(R.getReferenceeType()));
+ return llvm::PointerType::getUnqual(ConvertType(R.getReferenceeType()));
}
case Type::VariableArray: {
@@ -224,7 +224,7 @@
// Struct return passes the struct byref.
if (!ResultType->isFirstClassType() && ResultType != llvm::Type::VoidTy) {
- const llvm::Type *RType = llvm::PointerType::get(ResultType);
+ const llvm::Type *RType = llvm::PointerType::getUnqual(ResultType);
QualType RTy = Context.getPointerType(FP.getResultType());
TypeHolderMap.insert(std::make_pair(RTy.getTypePtr(),
llvm::PATypeHolder(RType)));
@@ -355,7 +355,7 @@
ArgTys.push_back(Ty);
else {
QualType PTy = Context.getPointerType(FTP.getArgType(i));
- const llvm::Type *PtrTy = llvm::PointerType::get(Ty);
+ const llvm::Type *PtrTy = llvm::PointerType::getUnqual(Ty);
TypeHolderMap.insert(std::make_pair(PTy.getTypePtr(),
llvm::PATypeHolder(PtrTy)));
More information about the cfe-commits
mailing list