The mining codefunctionality that does background mining in the Bitcoin core was removed in August of 2016. See the following change log:
https://bitcoin.org/en/release/v0.13.0
Before version 13, theThe mining code wasitself is still available for testing and experimentation and is located in a filethe files called "miner.cpp" and "miner.h" which are in the main src directory.