How to output a .S *and* a .OBJ file?

Hi,

I’m embarrassed that I can’t figure this out… I have a compiler that outputs my module in either .s assembly format or .obj binary format, either one works just fine. But if I try to output both of them by adding passes, LLVM throws an Assert:

void WinCOFFStreamer::EmitLabel(MCSymbol *Symbol) {
assert(Symbol->isUndefined() && “Cannot define a symbol twice!”);
MCObjectStreamer::EmitLabel(Symbol);
}

I attached my code which attempts to make it output both… if I comment out the lines for one or the other it works just fine.
That code is just a copy of the llvm c compiler’s code, changed slightly to suit my needs.

A general “do this and then this” answer will probably get me on the right path…

Thanks!!

llvmq.txt (2.69 KB)