diff gen/tollvm.cpp @ 648:8d850fa25713

Fix VarDecls for tuples. Closes #99. I've implemented it this way since it doesn't require any changes in the frontend. However, I think having TypeTuple expressed as LLVM struct types would make much more sense and open the door to tuple lvalues.
author Christian Kamm <kamm incasoftware de>
date Sun, 05 Oct 2008 11:47:47 +0200
parents 29dc68c949b0
children aa6a0b7968f7
line wrap: on
line diff
--- a/gen/tollvm.cpp	Sat Oct 04 23:28:49 2008 +0200
+++ b/gen/tollvm.cpp	Sun Oct 05 11:47:47 2008 +0200
@@ -169,6 +169,16 @@
         return getPtrToType(LLStructType::get(DtoType(taa->key), DtoType(taa->next), 0));
     }
 
+/*
+    Not needed atm as VarDecls for tuples are rewritten as a string of 
+    VarDecls for the fields (u -> _u_field_0, ...)
+
+    case Ttuple:
+    {
+        TypeTuple* ttupl = (TypeTuple*)t;
+        return DtoStructTypeFromArguments(ttupl->arguments);
+    }
+*/
     // opaque type
     case Topaque:
         return llvm::OpaqueType::get();
@@ -182,6 +192,26 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
+/*
+const LLType* DtoStructTypeFromArguments(Arguments* arguments)
+{
+    if (!arguments)
+        return LLType::VoidTy;
+
+    std::vector<const LLType*> types;
+    for (size_t i = 0; i < arguments->dim; i++)
+    {
+        Argument *arg = (Argument *)arguments->data[i];
+        assert(arg && arg->type);
+
+        types.push_back(DtoType(arg->type));
+    }
+    return LLStructType::get(types);
+}
+*/
+
+//////////////////////////////////////////////////////////////////////////////////////////
+
 const LLType* DtoTypeNotVoid(Type* t)
 {
     const LLType* lt = DtoType(t);