Identified-particle production and spectra with the ALICE detector in pp and Pb–Pb collisions at the LHC