[WebAssembly] Add Emscripten OS definition + small_printf
authorAlon Zakai <azakai@google.com>
Wed, 3 Apr 2019 01:08:35 +0000 (01:08 +0000)
committerAlon Zakai <azakai@google.com>
Wed, 3 Apr 2019 01:08:35 +0000 (01:08 +0000)
commitb4f9991f383e1a864eb6d994400394f489060b27
tree00f7d7d46834bba207c5f48b0d36ec447de502ef
parent31d7394dc7c759b501efd5ca2a70f2e1e286f127
[WebAssembly] Add Emscripten OS definition + small_printf

The Emscripten OS provides a definition of __EMSCRIPTEN__, and also that it
supports iprintf optimizations.

Also define small_printf optimizations, which is a printf with float support
but not long double (which in wasm can be useful since long doubles are 128
bit and force linking of float128 emulation code). This part is based on
sunfish's https://reviews.llvm.org/D57620 (which can't land yet since
the WASI integration isn't ready yet).

Differential Revision: https://reviews.llvm.org/D60167

llvm-svn: 357552
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/OSTargets.h
llvm/include/llvm/ADT/Triple.h
llvm/include/llvm/Analysis/TargetLibraryInfo.def
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Support/Triple.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp