AsmPrinter directory


While trying to debug a linking problem related to AsmPrinter, I found
following lines in {srcdir}/configure file.

  if test -f ${srcdir}/lib/Target/${target_to_build}/*AsmPrinter.cpp ; then

It looks like the AsmPrinters are enumerated only if *AsmPrinter.cpp
file is present in {srcdir}/lib/Target/${target_to_build}

Does this means that making a separate directory for AsmPrinter is no
more supported. I saw other architectures have also moved the files
from ${target_to_build}AsmPrinter/ to ${target_to_build}.


Hi Ankur,

The old 'AsmPrinter' directory has been renamed to "InstPrinter". The *AsmPrinter.cpp file drives the overall process, using the InstPrinter to handle the details. These days, normally that's done by converting (in *AsmPrinter.cpp) the MachineInstr's to MCInst's, then passing those MCInst's to an output MCStreamer. If the streamer is an assembly printer, the output will go via the InstPrinter for each instruction (and directive). If it's an object file, it'll use the *MCCodeEmitter.cpp interface instead. Or any other streamer the target has elected to implement for that matter, but those two are the main situations.