MFC r244280 (by pjd):
sbuf_trim() cannot be used on sbuf with drain function set.
This fixes panic when listing sysctls on INVARIANTS-enabled kernel while
having wbwd loaded.

This panic was not fatal, at worst one additional space was printed.

Also sbuf_trim() makes some sense even if drain function is set. The drain
function is called only when buffer is to be expanded. So we could still trim
existing buffer before drain is called. In this case it worked just fine - the
trailing space was correctly trimmed.
MFC r256082 (by decke)

Rename internal function test() to avoid name clashes with common
macros. This fixes ports like mysql 5.6 which has an internal macro
called test.

Discussed with:	theraven
MFC r253802:

Pull in r186696 from upstream clang trunk:

  This patch implements __get_cpuid_max() as an inline and __cpuid()
  and __cpuid_count() as macros to be compatible with GCC's cpuid.h.
  It also adds bit_<foo> constants for the various feature bits as
  described in version 039 (May 2011) of Intel's SDM Volume 2 in the
  description of the CPUID instruction.  The list of bit_<foo>
  constants is a bit exhaustive (GCC doesn't do near this many).  More
  bits could be added from a newer version of SDM if desired.

  Patch by John Baldwin!

This should fix several ports which depend on this functionality being
available.
MFC r255076:

Pull in r189672 from upstream llvm trunk:

  InstCombine: Check for zero shift amounts before subtracting one
  causing integer overflow.

  PR17026. Also avoid undefined shifts and shift amounts larger than 64
  bits (those are always undef because we can't represent integer types
  that large).

This should fix assertion failures when building the emulators/xmame
port.

Reported by:	bapt
MFC r257109:

Add clang-CC and CC to list of hints allowing clang to identify its operating
mode as c++ instead of defaulting to c for the binary names CC and clang-CC.

This fixes builds that use cmake, which automatically sets CXX to
/usr/bin/CC by default.

PR:		bin/182442
Reviewed by:	dwhite, wca
Merge branch 'stable/9' into feature/dhclient-tzcode/stable/9