Replace non-portable '\e' with '\033' (ESC)

Summary: Warp complains about the use of '\e' as a character literal, which indeed is not allowed (see e.g. http://en.cppreference.com/w/cpp/language/escape). However, I just checked and gcc does accept the sequence. To keep code portable I replaced \e with \033.

Reviewed By: @jdelong

Differential Revision: D1429142
detect proper libdwarf types

Summary: Current master is broken by libdwarf once again. Other than checking for
a particular init function we should also check if we're allowed to use
a const char* for name separately.

Combined them into a macro for future changes.
Closes #3163
Created from: https://github.com/facebook/hhvm/pull/3163

Reviewed By: @ptarjan

Differential Revision: D1429569
Fix a off-by-one error in hack format region mode and make it available in js

Summary: In region mode in the formatter, the formatter was letting the previous token through.

Imagine the following situation:

[0] = \n
[1] = i
[2] = f

I have selected my region to be from position 1 to the end.

With the old logic, when \n is being processed, pos=0 and new_pos=1. Because new_pos is within the region, silent mode is off for \n, even though I have not selected it in my region.

Using new_pos looks intentional, because it's trying to figure out where my current token ends, so this is an off by 1 error.

Reviewed By: @jwatzman

Differential Revision: D1429649
Fix huge stack usage in `Naming.expr_`

Summary: We were apparently just on the edge of what was acceptable
here, and adding frame pointers in the ocaml runtime/compiler pushed us
over the limit. Do something tail recursive.

Reviewed By: @elgenie

Differential Revision: D1429996
Revert "detect proper libdwarf types"

Summary: refs facebook/hhvm#3163

Breaks centos build: https://gist.github.com/fredemmott/ffa79f0c9cadd30b87ba

Reviewed By: @ptarjan

Differential Revision: D1430034
typechecker: interaction of interface req + trait req + inheritance

Summary: ... very subtle bug with the visibility of protected methods
 inside traits when the relevant requirements go through an interface.

Reviewed By: @jwatzman

Differential Revision: D1428536
Do not produce refcount in LdResumableArObj, use TakeRef instead

Summary: LdResumableArObj just loads pointer to an object, but does not produce
reference count, so remove the PRc tag. Instead, add TakeRef opcode to
produce the reference count to make refcount optimizer aware of implicitly
owned references.

Reviewed By: @swtaarrs

Differential Revision: D1429349
delete extra space on main.cpp

Summary: Closes #3164
Created from: https://github.com/facebook/hhvm/pull/3164

Reviewed By: sgolemon, liranuna

Differential Revision: D1429520