Merge remote-tracking branch 'origin/swift-3.1-branch' into stable

* origin/swift-3.1-branch:
  [Sema][Comments] Support @param with c++ 'using' keyword
  Test commit (Removing trailing whitespace).
  [Sema] Don't crash on scanf on forward-declared enums.
  PR28423: Compare primary declaration contexts.
  [Driver] Remove unused #include of llvm/Support/config.h
  PR28794: Don't try to instantiate function templates which are not visible.
  Use __has_include rather than a configure-time macro to determine if <sys/resource.h> is available. This should fix out-of-tree builds, at the cost of not providing the higher rlimits to stage 1 clang when built with an old host compiler not implementing this feature yet (bootstrap builds should be fine, though).
  [CMake] Adding toolchain targets to PGO and Apple CMake caches
  PR18417: Increase -ftemplate-depth to the value 1024 recommended by the C++ standard's Annex B. We now attempt to increase the process's stack rlimit to 8MiB on startup, which appears to be enough to allow this to work reliably. (And if it turns out not to be, we can investigate increasing it further.)
  [CodeGen][ObjC] Fix infinite recursion in getObjCEncodingForTypeImpl.
  Add missing close brace to fix Windows bots. Oops :(
  If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work around a Linux kernel bug where the actual amount of available stack may be a *lot* lower than the rlimit.