I’m working on building a target for llvm that’s the intermediate language of another compiler, so that the other compiler can benifit from llvm’s optimization passes.
I essentially made a copy of the mips backend, and then started changing the output to match the intermediate language of the compiler. Most of the output can be overriden, but I haven’t figured out how to change the way globals are emitted.
The AsmPrinter::EmitGlobalVariable function in the llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp file is not virtual; if I try to override it, I get a “multiple definitions” error. To emit the global, it just calls the OutputStreamer.EmitCommonSymbol method. Again, this has become a problem because I don’t want the default output for global symbols. If I can’t override this method, how can I change the way that my target outputs globals variables?
I'm working on building a target for llvm that's the intermediate language
of another compiler, so that the other compiler can benifit from llvm's
optimization passes.
I essentially made a copy of the mips backend, and then started changing the
output to match the intermediate language of the compiler. Most of the
output can be overriden, but I haven't figured out how to change the way
globals are emitted.
The AsmPrinter::EmitGlobalVariable function in the
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp file is not virtual; if I try to
override it, I get a "multiple definitions" error. To emit the global, it
just calls the OutputStreamer.EmitCommonSymbol method. Again, this has
become a problem because I don't want the default output for global symbols.
If I can't override this method, how can I change the way that my target
outputs globals variables?
Ryan,
On which version are you working? I can see, since r93858;