More changes for HPHP to help make it clang friendly
~~~hphp/compiler/expression/constant_expression.h
~~~hphp/compiler/expression/function_call.h
rfind returns a size_t/unsigned int
~~~hphp/runtime/base/server/http_protocol.cpp
Switched to std::to_string. Assuming [] was not intended here
~~~hphp/runtime/base/ref_data.h
These fields were accessed in a public manner, assuming public was intended
instead of private
~~~hphp/runtime/base/variable_serializer.cpp
Switched to using [] and & to make clang happy. Assuming this was to either
take or drop the first char.
~~~hphp/runtime/ext/asio/asio_external_thread_event_queue.h
~~~hphp/runtime/ext/asio/asio_external_thread_event_queue.cpp
Cast which performs the conversions of a reinterpret_cast is not
allowed in a constant expression. This is been moved to a macro as a temporary
fix.
+++hphp/runtime/ext/ext_misc.cpp
Added std::atomic to supress warnings
~~~hphp/runtime/vm/jit/simplifier.cpp
Chosen constructor is explicit in copy-initialization
~~~hphp/runtime/vm/jit/translator-asm-helpers.S
Ambiguous instructions require an explicit suffix
Changed cmp to cmpl
~~~hphp/runtime/vm/jit/translator-x64-helpers.cpp
Clang does not support global register variables
+++hphp/runtime/vm/unwind.cpp
describeFault was only used when DEBUG or USE_TRACE was defined
~~~hphp/runtime/vm/verifier/check_unit.cpp
Made fmt pointer const to avoid string format issues/warnings
~~~hphp/util/stack_trace.cpp
Clang does not support variable-length arrays.
Uniqe_ptr is used instead to take advantage runtime-sized arrays, a
restriced form of variable-length arrays
~~~hphp/util/thread_local.h
Clang seems to be supporting the __thread attribute, or at the very least
it is not complaining about it.
~~~hphp/util/tiny_vector.h
Clang does not like the flexible array here, since T is not always POD.
I have reimplemented the array here by just sticking one value in the struct
and calculating the offset from its address manually.
Alterinatively, we could change the the non-POD types to be pointers, or
we could edit their implemenations.
+++hphp/util/util.h
Created a template for the union,
A function declared with the constexpr specifier cannot contain
type declarations that do not define classes or enumerations
+++hphp/runtime/vm/jit/x64-util.h
Added a TODO
The way hphp/runtime/vm/jit/x64-util.h is currently implemented, it only
works if USE_GCC_FAST_TLS is defined
I'm adding the count of connected debuggers, and whether or not the process is hphpd, to the crash reports. In another diff I'll wire these up to hphpcrash_categorizer.py and get these as columns in the Hphpcrash Scuba data set so we can filter crash reports based on whether or not it's from hphpd, and whether or not a server was being debugged when it crashed.
I was learning from @jdelong and he said that you should use
double quotes for local includes and angle brackets for library
includes. I asked why our code was the way it was, and he said he wanted
to clean it up. I beat him to it :)
Conflicts:
hphp/runtime/base/server/admin_request_handler.cpp
hphp/runtime/vm/named_entity.h
This diff introduces assert_throw, assert_log, and always_assert_ versions of
the two. They behave similarly to assert, but assert_throw throws a
FailedAssertion exception instead of calling abort. This lets us catch the
exception and add additional debug info to the stacktrace file. In the case of
the IR, this is the current Trace. assert_log takes the condition to check and
a lambda that is expected to return a std::string. If the condition fails, the
lambda will be evaluated and the text returned will be included in the
stacktrace file.
I've left assert_throw off by default so people have to opt into it
locally or in Perflab (see the comment in assert_throw.h)
g++-4.7.1 treats "FOO"bar as a c++-11 literal operator, even
if bar is a macro with an expansion such as "BAR" - so add a space
after the quote (this seems like a bug, and I fixed a bunch of these
a while ago, but we just added a slew of PRI*64 macros which break
under 4.7.1).
Also, it warned that "explicit by-copy capture of 'this' redundant"
for a lambda declared [=, this] - so I removed the this.
We also needed more than the 60 levels of template expansion that was
allowed by the makefile.
Per @mwilliams' suggestion, this is the first stage in a staggered approach to replacing int64 with int64_t. More precisely I inserted "typedef ::int64_t int64;" in util/base.h and dealt with the consequences.
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.