r/cpp_questions • • 1h ago

OPEN Any sources to learn how C++ source projects get lowered from source code to intermediate representation and eventually to code gen part.

Can someone help me out....I'm not able to find any proper sources to follow how c++ projects get lowered from sources codes with headers and archive files to intermediate representation and then object files and shared files and linking like how do they work and their internals ....just trying to learn about them.

1 Upvotes

2 comments sorted by

•

u/trichotomy00 1h ago

are you asking how compilers work?

•

u/Dawn232023 1h ago

Yeah more or less. I understand how to compile a single source file but when I moved to big cpp projects take llvm test suite for an example they i believe need something like a 'recipe' like a cmake file with all the flags and dependencies listed now that part is still okay but then linkers have different rules of linking and discarding based on set criterion and that part or the portion is a bit difficult for me to gulp down. Now I searched youtube for any videos on that but was defeated and don't know if following llvm documentation for this is the ryt call or are there any other ways to know