builtins: avoid endian.h in favour of compiler builtins

Use the __BYTE_ORDER__ macro which has been available in GCC since 4.6 and is
available in clang as well.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220626 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Make StackTrace a lightweight reference to array of PCs, and
introduce a BufferedStackTrace class, which owns this array.

Summary:
This change splits __sanitizer::StackTrace class into a lightweight
__sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace,
which owns it. This would allow us to simplify the interface of StackDepot,
and eventually merge __sanitizer::StackTrace with __tsan::StackTrace.

Test Plan: regression test suite.

Reviewers: kcc, dvyukov

Reviewed By: dvyukov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5985

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220635 91177308-0d34-0410-b5e6-96231b3b80d8
Fixup deadlock sanitizer after r220635

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220636 91177308-0d34-0410-b5e6-96231b3b80d8
Change StackDepot interface to use StackTrace more extensively

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220637 91177308-0d34-0410-b5e6-96231b3b80d8