diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-26 23:13:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-26 23:13:19 +0000 |
commit | 726b3d09cdd91f7519a823a2b52df7e28483bf18 (patch) | |
tree | 7b34651d3254252b75b20e8c5ef9ee063945c54c /clang/lib/CodeGen | |
parent | 6c5abe88bff9a4cd5abfa8bb793ecfdfc219a06b (diff) | |
download | bcm5719-llvm-726b3d09cdd91f7519a823a2b52df7e28483bf18.tar.gz bcm5719-llvm-726b3d09cdd91f7519a823a2b52df7e28483bf18.zip |
reduce indentation
llvm-svn: 106967
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 9a63a74fea6..283f3610af1 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -800,50 +800,51 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, llvm::Value *ReturnValue) { - llvm::Value *RV = 0; - // Functions with no result always return void. - if (ReturnValue) { - QualType RetTy = FI.getReturnType(); - const ABIArgInfo &RetAI = FI.getReturnInfo(); + if (ReturnValue == 0) { + Builder.CreateRetVoid(); + return; + } + + llvm::Value *RV = 0; + QualType RetTy = FI.getReturnType(); + const ABIArgInfo &RetAI = FI.getReturnInfo(); - switch (RetAI.getKind()) { - case ABIArgInfo::Indirect: - if (RetTy->isAnyComplexType()) { - ComplexPairTy RT = LoadComplexFromAddr(ReturnValue, false); - StoreComplexToAddr(RT, CurFn->arg_begin(), false); - } else if (CodeGenFunction::hasAggregateLLVMType(RetTy)) { - // Do nothing; aggregrates get evaluated directly into the destination. - } else { - EmitStoreOfScalar(Builder.CreateLoad(ReturnValue), CurFn->arg_begin(), - false, RetTy); - } - break; + switch (RetAI.getKind()) { + case ABIArgInfo::Indirect: + if (RetTy->isAnyComplexType()) { + ComplexPairTy RT = LoadComplexFromAddr(ReturnValue, false); + StoreComplexToAddr(RT, CurFn->arg_begin(), false); + } else if (CodeGenFunction::hasAggregateLLVMType(RetTy)) { + // Do nothing; aggregrates get evaluated directly into the destination. + } else { + EmitStoreOfScalar(Builder.CreateLoad(ReturnValue), CurFn->arg_begin(), + false, RetTy); + } + break; - case ABIArgInfo::Extend: - case ABIArgInfo::Direct: - // The internal return value temp always will have - // pointer-to-return-type type. - RV = Builder.CreateLoad(ReturnValue); - break; + case ABIArgInfo::Extend: + case ABIArgInfo::Direct: + // The internal return value temp always will have + // pointer-to-return-type type. + RV = Builder.CreateLoad(ReturnValue); + break; - case ABIArgInfo::Ignore: - break; + case ABIArgInfo::Ignore: + break; - case ABIArgInfo::Coerce: - RV = CreateCoercedLoad(ReturnValue, RetAI.getCoerceToType(), *this); - break; + case ABIArgInfo::Coerce: + RV = CreateCoercedLoad(ReturnValue, RetAI.getCoerceToType(), *this); + break; - case ABIArgInfo::Expand: - assert(0 && "Invalid ABI kind for return argument"); - } + case ABIArgInfo::Expand: + assert(0 && "Invalid ABI kind for return argument"); } - if (RV) { + if (RV) Builder.CreateRet(RV); - } else { + else Builder.CreateRetVoid(); - } } RValue CodeGenFunction::EmitDelegateCallArg(const VarDecl *Param) { |