Stronger-than-expected earnings reports have helped drive the major U.S. indexes to recent highs.