]> granicus.if.org Git - clang/commitdiff
Simplify test for whether we need an alloca to hold an indirect return
authorDaniel Dunbar <daniel@zuster.org>
Thu, 5 Feb 2009 09:24:53 +0000 (09:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 5 Feb 2009 09:24:53 +0000 (09:24 +0000)
value.
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index 703bcd0d852615ab83726f211653e1907bd0ca2f..af3ea74d23e9a9a225997b88aa8d1e64474a7f49 100644 (file)
@@ -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() &&