diff gen/tocall.cpp @ 720:e177ae483f8e

Added inreg attribute where appropriate on x86 to follow ABI docs. Removed now unnecessary temporary variable in StringExp.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 23 Oct 2008 00:34:46 +0200
parents 7261ff0f95ff
children 55f6c2e454d7
line wrap: on
line diff
--- a/gen/tocall.cpp	Wed Oct 22 21:50:08 2008 +0200
+++ b/gen/tocall.cpp	Thu Oct 23 00:34:46 2008 +0200
@@ -257,6 +257,8 @@
         LLValue* retvar = DtoAlloca(argiter->get()->getContainedType(0), ".rettmp");
         ++argiter;
         args.push_back(retvar);
+
+        // add attrs for hidden ptr
         palist = palist.addAttr(1, llvm::Attribute::StructRet);
     }
 
@@ -299,6 +301,10 @@
             error(loc, "Context argument required but none given");
             fatal();
         }
+
+        // add attributes for context argument
+        if (tf->thisAttrs)
+            palist = palist.addAttr(retinptr?2:1, tf->thisAttrs);
     }
 
     // handle the rest of the arguments based on param passing style