It had been revealed to him by the Holy Spirit that he should not see death before he had seen the Lord's Christ.{"Christ" (Greek) and "Messiah" (Hebrew) both mean "Anointed One"}
And so he is telling Mary, "Look, this child is set for great blessings to the people, but it's going to pierce as a sword through your own soul." Preparing her for the agony and the pain that she would experience, as she would watch one day this child, hanging on the cross.