Page 1 of 1

CXX/clang listing files

Posted: Thu Nov 30, 2023 7:05 pm
by mberryman
How close are the CXX/clang compilers to generating listing files? I've run into a problem that I do not know how to solve without a listing file. Specifically, the compiled module has some very strange (but legitimate) symbol references in it and I need to figure out what is creating them (so I can figure out how to resolve them).

Re: CXX/clang listing files

Posted: Mon Dec 04, 2023 9:22 am
by jreagan
Would the -E on the clang command line help? That's the closest you get right now

$ cxx/clang="-E" hw.cxx

or you can get the .s file (which has some symbolization compared to the ANAL/OBJ/DISA) with

$ cxx/clang="-S" hw.cxx

As for support in the compiler itself, you can imagine that no such concept exists in the clang sources. Listing files which combine sources, error message, optional header lines, optional macro expansion lines, etc. is a totally foreign concept. Most of the changes we've made to clang (including dual-size pointers) have leveraged some existing code in the frontend. Listing files is a blank sheet for us. That said, we're working on it with some early work but it is probably a month or two away.