Allow diagnostic handlers to check for optimization remarks.