Fixes PR34966 as added call graph edges allow to build correct module
imports/exports. With fixed imports/exports ThinLTO can see which
functions are used and keeps both static and non-static functions as
both of them are used.
rdar://problem/35099885
The following testcase triggers this assertion:
define void @caller() { tail call void select (i1 icmp eq (i32* @a, i32* null), void ()* @f, void ()* @g)() ret void } declare void @f() declare void @g() @a = extern_weak global i32