[stackprotector] Modernize code with IRBuilder