From 632c823b8bfd3fd5a4b77628eddd6161c5d8367e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 24 Feb 2014 08:50:27 -0800 Subject: Define an Emscripten toolchain. This is pretty minimal right now; eventually this may subsume code currently in the emscripten wrapper scripts. --- lib/Driver/Driver.cpp | 3 +++ lib/Driver/ToolChains.cpp | 30 ++++++++++++++++++++++++++++++ lib/Driver/ToolChains.h | 14 ++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 1dbbc9a342..6d0ac5733a 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1759,6 +1759,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args, case llvm::Triple::Win32: TC = new toolchains::Windows(*this, Target, Args); break; + case llvm::Triple::Emscripten: + TC = new toolchains::EmscriptenToolChain(*this, Target, Args); + break; case llvm::Triple::MinGW32: // FIXME: We need a MinGW toolchain. Fallthrough for now. default: diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index fffba0e4e5..2f3cf15490 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1738,6 +1738,36 @@ bool TCEToolChain::isPICDefaultForced() const { return false; } +/// EmscriptenToolChain - A tool chain for the Emscripten C/C++ to JS compiler. + +EmscriptenToolChain::EmscriptenToolChain(const Driver &D, const llvm::Triple& Triple, + const ArgList &Args) + : ToolChain(D, Triple, Args) { +} + +EmscriptenToolChain::~EmscriptenToolChain() { +} + +bool EmscriptenToolChain::IsMathErrnoDefault() const { + return false; +} + +bool EmscriptenToolChain::IsObjCNonFragileABIDefault() const { + return true; +} + +bool EmscriptenToolChain::isPICDefault() const { + return false; +} + +bool EmscriptenToolChain::isPIEDefault() const { + return false; +} + +bool EmscriptenToolChain::isPICDefaultForced() const { + return false; +} + /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly. OpenBSD::OpenBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 3afd8dd228..50973073da 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -577,6 +577,20 @@ public: bool isPICDefaultForced() const; }; +/// EmscriptenToolChain - A tool chain for the Emscripten C/C++ to JS compiler. +class LLVM_LIBRARY_VISIBILITY EmscriptenToolChain : public ToolChain { +public: + EmscriptenToolChain(const Driver &D, const llvm::Triple& Triple, + const ArgList &Args); + ~EmscriptenToolChain(); + + bool IsMathErrnoDefault() const; + bool IsObjCNonFragileABIDefault() const; + bool isPICDefault() const; + bool isPIEDefault() const; + bool isPICDefaultForced() const; +}; + class LLVM_LIBRARY_VISIBILITY Windows : public ToolChain { public: Windows(const Driver &D, const llvm::Triple& Triple, const ArgList &Args); -- cgit v1.2.3-18-g5258