diff options
author | Alon Zakai <azakai@google.com> | 2019-04-03 01:08:35 +0000 |
---|---|---|
committer | Alon Zakai <azakai@google.com> | 2019-04-03 01:08:35 +0000 |
commit | b4f9991f383e1a864eb6d994400394f489060b27 (patch) | |
tree | 00f7d7d46834bba207c5f48b0d36ec447de502ef /llvm/lib/Support/Triple.cpp | |
parent | 31d7394dc7c759b501efd5ca2a70f2e1e286f127 (diff) | |
download | llvm-b4f9991f383e1a864eb6d994400394f489060b27.zip llvm-b4f9991f383e1a864eb6d994400394f489060b27.tar.gz llvm-b4f9991f383e1a864eb6d994400394f489060b27.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r-- | llvm/lib/Support/Triple.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index 83ce4f0..a5a25d2 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -208,6 +208,7 @@ StringRef Triple::getOSTypeName(OSType Kind) { case HermitCore: return "hermit"; case Hurd: return "hurd"; case WASI: return "wasi"; + case Emscripten: return "emscripten"; } llvm_unreachable("Invalid OSType"); @@ -506,6 +507,7 @@ static Triple::OSType parseOS(StringRef OSName) { .StartsWith("hermit", Triple::HermitCore) .StartsWith("hurd", Triple::Hurd) .StartsWith("wasi", Triple::WASI) + .StartsWith("emscripten", Triple::Emscripten) .Default(Triple::UnknownOS); } |