The tax code is complicated BECAUSE it was lobbied so that only the few have the resources to (ab)use it. If you think that a Trump in office would not act protectionist you are fooling yourself. I'm not saying Hillary in this matter would be any better.
The companies will stay as long as the US is a large market, because they need the presence.
Re: your comment that you couldn't edit in on walling off. If at first we take the literal part: [1].
On the economic part, undocumented workers have contributed 10% of the social security trust fund, while only being eligible for 1/15th of that in return, so that's a 14 to 1 net positive [2].
They (undocumented workers) also pay $11.64bn annually in state and local tax [3].
[1] http://foreignpolicy.com/2015/08/18/donald-trump-immigration...
[2] http://www.nytimes.com/2013/02/17/magazine/do-illegal-immigr...
[3] http://itep.org/itep_reports/2016/02/undocumented-immigrants...