dyn_cast<FunctionProtoType>(BlockFunctionType)) {
ResultType = FTy->getResultType();
IsVariadic = FTy->isVariadic();
- }
- else {
+ } else {
// K&R style block.
ResultType = BlockFunctionType->getResultType();
IsVariadic = false;
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());
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());
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");
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
}
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");
}
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.
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?");
// __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 =
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()));
// 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);
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 =
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(),
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());
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");
}
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);
} 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);
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);
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);
}
// 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";
}
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
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();
ResultRegTypes.back() = llvm::IntegerType::get((unsigned)InputSize);
}
}
-
} else {
ArgTypes.push_back(Dest.getAddress()->getType());
Args.push_back(Dest.getAddress());