From cea3af4e5403f12e9e8b66360ca23bce66f322e0 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 5 Feb 2009 09:24:53 +0000 Subject: Simplify test for whether we need an alloca to hold an indirect return value. - No functionality change. llvm-svn: 63859 --- clang/lib/CodeGen/CGCall.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 703bcd0d852..af3ea74d23e 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1337,19 +1337,9 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // location that we would like to return into. QualType RetTy = CallInfo.getReturnType(); const ABIArgInfo &RetAI = CallInfo.getReturnInfo(); - switch (RetAI.getKind()) { - case ABIArgInfo::Indirect: + if (CGM.ReturnTypeUsesSret(CallInfo)) { // Create a temporary alloca to hold the result of the call. :( Args.push_back(CreateTempAlloca(ConvertType(RetTy))); - break; - - case ABIArgInfo::Direct: - case ABIArgInfo::Ignore: - case ABIArgInfo::Coerce: - break; - - case ABIArgInfo::Expand: - assert(0 && "Invalid ABI kind for return argument"); } assert(CallInfo.arg_size() == CallArgs.size() && -- cgit v1.2.3