Call Function::eraseFromParent() when codegen fails
Call Function::eraseFromParent() when codegen fails

Aborting codegen mid-function without erasing the function can result
in a corrupt module.

Change-Id: I64b518c8286195d78e68c2df5397a8843f6badc3
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4632
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Tested-by: jenkins

cgvarela/Impala,cgvarela/Impala,brightchen/Impala,henryr/Impala,scalingdata/Impala,gerashegalov/Impala,bowlofstew/Impala,bowlofstew/Impala,cloudera/recordservice,bratatidas9/Impala-1,placrosse/ImpalaToGo,cchanning/Impala,cchanning/Impala,XiaominZhang/Impala,theyaa/Impala,placrosse/ImpalaToGo,bratatidas9/Impala-1,theyaa/Impala,ImpalaToGo/ImpalaToGo,cloudera/recordservice,lnliuxing/Impala,scalingdata/Impala,rdblue/Impala,brightchen/Impala,caseyching/Impala,cchanning/Impala,lnliuxing/Impala,caseyching/Impala,gerashegalov/Impala,lirui-intel/Impala,bowlofstew/Impala,tempbottle/Impala,XiaominZhang/Impala,kapilrastogi/Impala,cgvarela/Impala,tempbottle/Impala,bratatidas9/Impala-1,lnliuxing/Impala,grundprinzip/Impala,bratatidas9/Impala-1,caseyching/Impala,rdblue/Impala,gerashegalov/Impala,brightchen/Impala,bratatidas9/Impala-1,cchanning/Impala,theyaa/Impala,caseyching/Impala,tempbottle/Impala,placrosse/ImpalaToGo,kapilrastogi/Impala,theyaa/Impala,cloudera/recordservice,tempbottle/Impala,gerashegalov/Impala,theyaa/Impala,cgvarela/Impala,gerashegalov/Impala,grundprinzip/Impala,rdblue/Impala,cchanning/Impala,kapilrastogi/Impala,rdblue/Impala,scalingdata/Impala,scalingdata/Impala,grundprinzip/Impala,rdblue/Impala,placrosse/ImpalaToGo,henryr/Impala,lirui-intel/Impala,kapilrastogi/Impala,cloudera/recordservice,rdblue/Impala,brightchen/Impala,lnliuxing/Impala,theyaa/Impala,kapilrastogi/Impala,grundprinzip/Impala,cloudera/recordservice,XiaominZhang/Impala,ImpalaToGo/ImpalaToGo,brightchen/Impala,caseyching/Impala,caseyching/Impala,henryr/Impala,bowlofstew/Impala,lirui-intel/Impala,lirui-intel/Impala,rdblue/Impala,grundprinzip/Impala,cloudera/recordservice,henryr/Impala,tempbottle/Impala,bratatidas9/Impala-1,gerashegalov/Impala,lnliuxing/Impala,tempbottle/Impala,grundprinzip/Impala,XiaominZhang/Impala,tempbottle/Impala,cchanning/Impala,ImpalaToGo/ImpalaToGo,placrosse/ImpalaToGo,ImpalaToGo/ImpalaToGo,scalingdata/Impala,cgvarela/Impala,lnliuxing/Impala,bowlofstew/Impala,brightchen/Impala,ImpalaToGo/ImpalaToGo,ImpalaToGo/ImpalaToGo,cloudera/recordservice,kapilrastogi/Impala,henryr/Impala,placrosse/ImpalaToGo,brightchen/Impala,XiaominZhang/Impala,cgvarela/Impala,XiaominZhang/Impala,bowlofstew/Impala,scalingdata/Impala,lirui-intel/Impala,cchanning/Impala,caseyching/Impala,lirui-intel/Impala,bratatidas9/Impala-1,henryr/Impala,kapilrastogi/Impala,theyaa/Impala,lirui-intel/Impala,cgvarela/Impala,bowlofstew/Impala,lnliuxing/Impala,gerashegalov/Impala,XiaominZhang/Impala