Fix instability in type constraint names
commite14489f630ed7a76fd36ab90cb3ec00c9c29642f
authorMark Williams <mwilliams@fb.com>
Thu, 31 Aug 2017 00:44:33 +0000 (30 17:44 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 31 Aug 2017 00:49:15 +0000 (30 17:49 -0700)
tree02b4c20468aae46cdf9136941f677187b39b204f
parentcfb74522779c6a79ac3a75ebe3b17b461ada3df7
Fix instability in type constraint names

Summary:
When dumping the bytecode for www builds, I was seeing a lot of differences like

```
  -  .method [public no_override trait] (170,175) <"HH\\Awaitable<HH\\int>" "HH\\Awaitable" hh_type extended_hint soft > genActivatedCount(<"HH\\bool" "HH\\bool" hh_type > $fuzzy = DV2("""true""")) {
  +  .method [public no_override trait] (170,175) <"HH\\Awaitable<HH\\int>" "HH\\Awaitable" hh_type extended_hint soft > genActivatedCount(<"HH\\bool" "HH\\bool" hh_type > $fuzzy = DV2("""true""")) {
```

We were modifying the hphpc TypeAnnotation after using it to generate
the retUserType string - but in the case of traits, the TypeAnnotation
was shared between multiple copies of the method, and so there was a
race, and we could end up generating the retUserType string after the
TypeAnnotation had been modified.

Reviewed By: ricklavoie, alexeyt

Differential Revision: D5740434

fbshipit-source-id: 3b65ff9914199ab8c911af7db95b1093f40083e8
hphp/compiler/analysis/emitter.cpp