求助分词的选择题!

问题描述:

求助分词的选择题!
Then she swam to the shore after spending the whole night in the water.
after后面为什么用分词?
这一题又是怎么回事
She swam to the shore_____the night in the water?
A. having spent
B. having spending
C. when spending
D. had spent
为什么不选C 要选A?
还有 为什么要用have。这题真难啊~

after是介词
having后的是先发生的,发生在having done前面的单词之前,要记住