[Issue 5051] dmd flag for partial compilation (similar to just running preprocessor in C/C++)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 19 00:12:01 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5051


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-10-19 00:11:20 PDT ---
Agreed, I actually use this a lot when debugging backend bugs.
What I do is modify FuncDeclaration::toObjFile() in glue.c.
To do it properly would require a (fairly simple) pass over the syntax tree,
but the function case one is the most important by far. As you can see, it's
very simple.
Incidentally, when properly implemented, this feature would bring us much of
the way towards having a C backend.


                //printf("'%s' is SCfastpar\n",sp->Sident);
            }
        }
    }
+ if (!parent->isDeclaration()) {    
+       printf("%s ", ((TypeFunction *)(func->type))->next->toChars());
+       printf("%s(%s)\n{\n %s}\n\n", func->toChars(),
+            parameters?parameters->toChars() : "",
+            func->fbody->toChars());
+ }
    if (func->fbody)
    {   block *b;
        Blockx bx;
        Statement *sbody;

        localgot = NULL;

        sbody = func->fbody;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list