Refactor extendsfdf2.

Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D3887