[cfe-dev] Calling the assembler

Mike Miller michael.g.miller at gmail.com
Fri May 14 13:39:44 PDT 2010


Hi cfe-dev,

I am sending source code(and arguments for a -cc1 call) from computer
A to computer B. Computer B will compile the source and return object
code to computer A. I am able to compile the code using an
EmitAssemblyAction(and a CompilerInstance made from the arguments),
and I have the resulting assembly code in an std::string.

The problem is that invoking the assembler is turning out to be very
wasteful(or it appears that way). I've identified
driver::tools::gcc::Assemble, but in order to make an instance of the
Assemble tool, I have to make a Driver, and in order to construct the
job, I need to make a Compilation. This is problematic because I have
neither prior to doing the assembly, and it seems like it would be
wasteful to construct both.

My questions:
1. Does CompilerInstance or EmitAssemblyAction make a
Driver/Compilation which I can use in making an assembly job?

2. Is making a Driver/Compilation as expensive as I think it is?

3. Is this the right way to go about invoking the assembler?

Thanks,
Mike



More information about the cfe-dev mailing list