forked from OSchip/llvm-project
parent
59a2ab9720
commit
658fe02d17
|
@ -609,8 +609,7 @@ CodeGenFunction::GenerateBlockFunction(const BlockExpr *BExpr,
|
|||
dyn_cast<FunctionProtoType>(BlockFunctionType)) {
|
||||
ResultType = FTy->getResultType();
|
||||
IsVariadic = FTy->isVariadic();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// K&R style block.
|
||||
ResultType = BlockFunctionType->getResultType();
|
||||
IsVariadic = false;
|
||||
|
|
|
@ -515,8 +515,7 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD) {
|
|||
Ctor_Complete, V,
|
||||
Member->const_arg_begin(),
|
||||
Member->const_arg_end());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// non-static data member initilaizers.
|
||||
FieldDecl *Field = Member->getMember();
|
||||
QualType FieldType = getContext().getCanonicalType((Field)->getType());
|
||||
|
@ -572,8 +571,7 @@ void CodeGenFunction::EmitDtorEpilogue(const CXXDestructorDecl *DD) {
|
|||
LValue LHS = EmitLValueForField(LoadOfThis, FD, false, 0);
|
||||
EmitCXXDestructorCall(FieldClassDecl->getDestructor(getContext()),
|
||||
Dtor_Complete, LHS.getAddress());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const RecordType *RT =
|
||||
DD->getAnyBaseClassToDestroy(BaseOrMember)->getAs<RecordType>();
|
||||
CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(RT->getDecl());
|
||||
|
|
|
@ -329,8 +329,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
|
|||
DI->setLocation(D.getLocation());
|
||||
if (Target.useGlobalsForAutomaticVariables()) {
|
||||
DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D);
|
||||
}
|
||||
else if (isByRef) {
|
||||
} else if (isByRef) {
|
||||
llvm::Value *Loc;
|
||||
bool needsCopyDispose = BlockRequiresCopying(Ty);
|
||||
Loc = Builder.CreateStructGEP(DeclPtr, 1, "forwarding");
|
||||
|
|
|
@ -619,8 +619,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src,
|
|||
Vec = Builder.CreateShuffleVector(SrcVal,
|
||||
VMContext.getUndef(Vec->getType()),
|
||||
MaskV, "tmp");
|
||||
}
|
||||
else if (NumDstElts > NumSrcElts) {
|
||||
} else if (NumDstElts > NumSrcElts) {
|
||||
// Extended the source vector to the same length and then shuffle it
|
||||
// into the destination.
|
||||
// FIXME: since we're shuffling with undef, can we just use the indices
|
||||
|
@ -649,8 +648,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src,
|
|||
}
|
||||
llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size());
|
||||
Vec = Builder.CreateShuffleVector(Vec, ExtSrcVal, MaskV, "tmp");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// We should never shorten the vector
|
||||
assert(0 && "unexpected shorten vector length");
|
||||
}
|
||||
|
@ -679,8 +677,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
|
|||
LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
|
||||
getContext().getObjCGCAttrKind(E->getType()),
|
||||
E->getType().getAddressSpace());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
llvm::Value *V = LocalDeclMap[VD];
|
||||
assert(V && "DeclRefExpr not entered in LocalDeclMap?");
|
||||
// local variables do not get their gc attribute set.
|
||||
|
@ -733,8 +730,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
|
|||
return LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
|
||||
getContext().getObjCGCAttrKind(E->getType()),
|
||||
E->getType().getAddressSpace());
|
||||
}
|
||||
else if (const ImplicitParamDecl *IPD =
|
||||
} else if (const ImplicitParamDecl *IPD =
|
||||
dyn_cast<ImplicitParamDecl>(E->getDecl())) {
|
||||
llvm::Value *V = LocalDeclMap[IPD];
|
||||
assert(V && "BlockVarDecl not entered in LocalDeclMap?");
|
||||
|
@ -1083,8 +1079,7 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
|
|||
// __weak attribute on a field is ignored.
|
||||
if (attr == QualType::Weak)
|
||||
attr = QualType::GCNone;
|
||||
}
|
||||
else if (Ty->isObjCObjectPointerType())
|
||||
} else if (Ty->isObjCObjectPointerType())
|
||||
attr = QualType::Strong;
|
||||
}
|
||||
LValue LV =
|
||||
|
|
|
@ -243,8 +243,7 @@ void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
|
|||
CGF.EmitAggExpr(E->getRHS(), AggLoc, VolatileDest);
|
||||
CGF.EmitObjCPropertySet(LHS.getPropertyRefExpr(),
|
||||
RValue::getAggregate(AggLoc, VolatileDest));
|
||||
}
|
||||
else if (LHS.isKVCRef()) {
|
||||
} else if (LHS.isKVCRef()) {
|
||||
llvm::Value *AggLoc = DestPtr;
|
||||
if (!AggLoc)
|
||||
AggLoc = CGF.CreateTempAlloca(CGF.ConvertType(E->getRHS()->getType()));
|
||||
|
|
|
@ -378,7 +378,6 @@ ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
|
|||
|
||||
// Add the inc/dec to the real part.
|
||||
NextVal = Builder.CreateAdd(InVal.first, NextVal, isInc ? "inc" : "dec");
|
||||
|
||||
} else {
|
||||
QualType ElemTy = E->getType()->getAsComplexType()->getElementType();
|
||||
llvm::APFloat FVal(CGF.getContext().getFloatTypeSemantics(ElemTy), 1);
|
||||
|
|
|
@ -714,8 +714,7 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
|
|||
lhs = Builder.CreateBitCast(lhs, llvm::PointerType::getUnqual(i8Ty));
|
||||
LV = LValue::MakeAddr(lhs, ValTy.getCVRQualifiers(),
|
||||
CGF.getContext().getObjCGCAttrKind(ValTy));
|
||||
}
|
||||
else
|
||||
} else
|
||||
NextVal = Builder.CreateGEP(InVal, Inc, "ptrincdec");
|
||||
} else {
|
||||
const llvm::Type *i8Ty =
|
||||
|
|
|
@ -199,8 +199,7 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
|
|||
LValue LV = EmitLValueForIvar(TypeOfSelfObject(), LoadObjCSelf(), Ivar, 0);
|
||||
if (hasAggregateLLVMType(Ivar->getType())) {
|
||||
EmitAggregateCopy(ReturnValue, LV.getAddress(), Ivar->getType());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CodeGenTypes &Types = CGM.getTypes();
|
||||
RValue RV = EmitLoadOfLValue(LV, Ivar->getType());
|
||||
RV = RValue::get(Builder.CreateBitCast(RV.getScalarVal(),
|
||||
|
@ -337,16 +336,14 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
|
|||
GenerateMessageSend(*this, Exp->getType(), S,
|
||||
EmitScalarExpr(E->getBase()),
|
||||
false, CallArgList());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const ObjCKVCRefExpr *KE = cast<ObjCKVCRefExpr>(Exp);
|
||||
Selector S = KE->getGetterMethod()->getSelector();
|
||||
llvm::Value *Receiver;
|
||||
if (KE->getClassProp()) {
|
||||
const ObjCInterfaceDecl *OID = KE->getClassProp();
|
||||
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
||||
}
|
||||
else if (isa<ObjCSuperExpr>(KE->getBase()))
|
||||
} else if (isa<ObjCSuperExpr>(KE->getBase()))
|
||||
return EmitObjCSuperPropertyGet(KE, S);
|
||||
else
|
||||
Receiver = EmitScalarExpr(KE->getBase());
|
||||
|
@ -391,27 +388,23 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
|
|||
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,
|
||||
EmitScalarExpr(E->getBase()),
|
||||
false, Args);
|
||||
}
|
||||
else if (const ObjCKVCRefExpr *E = dyn_cast<ObjCKVCRefExpr>(Exp)) {
|
||||
} else if (const ObjCKVCRefExpr *E = dyn_cast<ObjCKVCRefExpr>(Exp)) {
|
||||
Selector S = E->getSetterMethod()->getSelector();
|
||||
CallArgList Args;
|
||||
llvm::Value *Receiver;
|
||||
if (E->getClassProp()) {
|
||||
const ObjCInterfaceDecl *OID = E->getClassProp();
|
||||
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
||||
}
|
||||
else if (isa<ObjCSuperExpr>(E->getBase())) {
|
||||
} else if (isa<ObjCSuperExpr>(E->getBase())) {
|
||||
EmitObjCSuperPropertySet(E, S, Src);
|
||||
return;
|
||||
}
|
||||
else
|
||||
} else
|
||||
Receiver = EmitScalarExpr(E->getBase());
|
||||
Args.push_back(std::make_pair(Src, E->getType()));
|
||||
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,
|
||||
Receiver,
|
||||
E->getClassProp() != 0, Args);
|
||||
}
|
||||
else
|
||||
} else
|
||||
assert (0 && "bad expression node in EmitObjCPropertySet");
|
||||
}
|
||||
|
||||
|
|
|
@ -1468,8 +1468,7 @@ CGObjCMac::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
|
|||
Target = EmitClassRef(CGF.Builder, Class->getSuperClass());
|
||||
Target = CGF.Builder.CreateStructGEP(Target, 0);
|
||||
Target = CGF.Builder.CreateLoad(Target);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
llvm::Value *MetaClassPtr = EmitMetaClassRef(Class);
|
||||
llvm::Value *SuperPtr = CGF.Builder.CreateStructGEP(MetaClassPtr, 1);
|
||||
llvm::Value *Super = CGF.Builder.CreateLoad(SuperPtr);
|
||||
|
@ -1541,8 +1540,7 @@ CodeGen::RValue CGObjCCommonMac::EmitLegacyMessageSend(
|
|||
} else {
|
||||
Fn = ObjCTypes.getSendFn2(IsSuper);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
// FIXME. This currently matches gcc's API for x86-32. May need to change
|
||||
// for others if we have their API.
|
||||
Fn = ObjCTypes.getSendFpretFn(IsSuper);
|
||||
|
@ -2509,10 +2507,8 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF,
|
|||
CGF.Builder.CreateStore(Caught, RethrowPtr);
|
||||
CGF.Builder.CreateStore(VMContext.getFalse(), CallTryExitPtr);
|
||||
CGF.EmitBranchThroughCleanup(FinallyRethrow);
|
||||
}
|
||||
else if (const ObjCAtCatchStmt* CatchStmt =
|
||||
cast<ObjCAtTryStmt>(S).getCatchStmts())
|
||||
{
|
||||
} else if (const ObjCAtCatchStmt* CatchStmt =
|
||||
cast<ObjCAtTryStmt>(S).getCatchStmts()) {
|
||||
// Enter a new exception try block (in case a @catch block throws
|
||||
// an exception).
|
||||
CGF.Builder.CreateCall(ObjCTypes.getExceptionTryEnterFn(), ExceptionData);
|
||||
|
@ -4527,8 +4523,7 @@ void CGObjCNonFragileABIMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) {
|
|||
Values[5] =
|
||||
EmitPropertyList(std::string("\01l_OBJC_$_PROP_LIST_") + ExtName,
|
||||
OCD, Category, ObjCTypes);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Values[4] = VMContext.getNullValue(ObjCTypes.ProtocolListnfABIPtrTy);
|
||||
Values[5] = VMContext.getNullValue(ObjCTypes.PropertyListPtrTy);
|
||||
}
|
||||
|
@ -5003,44 +4998,35 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
|
|||
// FIXME. Is there a better way of getting these names.
|
||||
// They are available in RuntimeFunctions vector pair.
|
||||
Name += "objc_msgSendId_stret_fixup";
|
||||
}
|
||||
else
|
||||
} else
|
||||
#endif
|
||||
if (IsSuper) {
|
||||
Fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
|
||||
Name += "objc_msgSendSuper2_stret_fixup";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fn = ObjCTypes.getMessageSendStretFixupFn();
|
||||
Name += "objc_msgSend_stret_fixup";
|
||||
}
|
||||
}
|
||||
else if (!IsSuper && ResultType->isFloatingType()) {
|
||||
} else if (!IsSuper && ResultType->isFloatingType()) {
|
||||
if (ResultType->isSpecificBuiltinType(BuiltinType::LongDouble)) {
|
||||
Fn = ObjCTypes.getMessageSendFpretFixupFn();
|
||||
Name += "objc_msgSend_fpret_fixup";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Fn = ObjCTypes.getMessageSendFixupFn();
|
||||
Name += "objc_msgSend_fixup";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
#if 0
|
||||
// unlike what is documented. gcc never generates this API!!
|
||||
if (Receiver->getType() == ObjCTypes.ObjectPtrTy) {
|
||||
Fn = ObjCTypes.getMessageSendIdFixupFn();
|
||||
Name += "objc_msgSendId_fixup";
|
||||
}
|
||||
else
|
||||
} else
|
||||
#endif
|
||||
if (IsSuper) {
|
||||
Fn = ObjCTypes.getMessageSendSuper2FixupFn();
|
||||
Name += "objc_msgSendSuper2_fixup";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fn = ObjCTypes.getMessageSendFixupFn();
|
||||
Name += "objc_msgSend_fixup";
|
||||
}
|
||||
|
@ -5225,11 +5211,9 @@ CGObjCNonFragileABIMac::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
|
|||
Target = EmitClassRef(CGF.Builder, Class);
|
||||
Target = CGF.Builder.CreateStructGEP(Target, 0);
|
||||
Target = CGF.Builder.CreateLoad(Target);
|
||||
}
|
||||
else
|
||||
} else
|
||||
Target = EmitMetaClassRef(CGF.Builder, Class);
|
||||
}
|
||||
else
|
||||
} else
|
||||
Target = EmitSuperClassRef(CGF.Builder, Class);
|
||||
|
||||
// FIXME: We shouldn't need to do this cast, rectify the ASTContext and
|
||||
|
@ -5463,8 +5447,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF,
|
|||
llvm::GlobalValue::ExternalLinkage,
|
||||
0, "OBJC_EHTYPE_id");
|
||||
SelectorArgs.push_back(IDEHType);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// All other types should be Objective-C interface pointer types.
|
||||
const ObjCObjectPointerType *PT =
|
||||
CatchDecl->getType()->getAsObjCObjectPointerType();
|
||||
|
|
|
@ -899,7 +899,6 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
|
|||
ResultRegTypes.back() = llvm::IntegerType::get((unsigned)InputSize);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
ArgTypes.push_back(Dest.getAddress()->getType());
|
||||
Args.push_back(Dest.getAddress());
|
||||
|
|
Loading…
Reference in New Issue