Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Native Client support #133661

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions clang/include/clang/Basic/TargetInfo.h
Original file line number Diff line number Diff line change
@@ -336,10 +336,6 @@ class TargetInfo : public TransferrableTargetInfo,
/// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
AArch64ABIBuiltinVaList,

/// __builtin_va_list as defined by the PNaCl ABI:
/// http://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Machine-Types
PNaClABIBuiltinVaList,

/// __builtin_va_list as defined by the Power ABI:
/// https://www.power.org
/// /resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Embedded.pdf
10 changes: 0 additions & 10 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
@@ -9760,14 +9760,6 @@ CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context) {
return Context->buildImplicitTypedef(VaListTagArrayType, "__builtin_va_list");
}

static TypedefDecl *CreatePNaClABIBuiltinVaListDecl(const ASTContext *Context) {
// typedef int __builtin_va_list[4];
llvm::APInt Size(Context->getTypeSize(Context->getSizeType()), 4);
QualType IntArrayType = Context->getConstantArrayType(
Context->IntTy, Size, nullptr, ArraySizeModifier::Normal, 0);
return Context->buildImplicitTypedef(IntArrayType, "__builtin_va_list");
}

static TypedefDecl *
CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context) {
// struct __va_list
@@ -9965,8 +9957,6 @@ static TypedefDecl *CreateVaListDecl(const ASTContext *Context,
return CreatePowerABIBuiltinVaListDecl(Context);
case TargetInfo::X86_64ABIBuiltinVaList:
return CreateX86_64ABIBuiltinVaListDecl(Context);
case TargetInfo::PNaClABIBuiltinVaList:
return CreatePNaClABIBuiltinVaListDecl(Context);
case TargetInfo::AAPCSABIBuiltinVaList:
return CreateAAPCSABIBuiltinVaListDecl(Context);
case TargetInfo::SystemZBuiltinVaList:
1 change: 0 additions & 1 deletion clang/lib/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -109,7 +109,6 @@ add_clang_library(clangBasic
Targets/Mips.cpp
Targets/NVPTX.cpp
Targets/OSTargets.cpp
Targets/PNaCl.cpp
Targets/PPC.cpp
Targets/RISCV.cpp
Targets/SPIR.cpp
12 changes: 0 additions & 12 deletions clang/lib/Basic/Targets.cpp
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@
#include "Targets/Mips.h"
#include "Targets/NVPTX.h"
#include "Targets/OSTargets.h"
#include "Targets/PNaCl.h"
#include "Targets/PPC.h"
#include "Targets/RISCV.h"
#include "Targets/SPIR.h"
@@ -225,8 +224,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
return std::make_unique<RTEMSTargetInfo<ARMleTargetInfo>>(Triple, Opts);
case llvm::Triple::Haiku:
return std::make_unique<HaikuTargetInfo<ARMleTargetInfo>>(Triple, Opts);
case llvm::Triple::NaCl:
return std::make_unique<NaClTargetInfo<ARMleTargetInfo>>(Triple, Opts);
case llvm::Triple::Win32:
switch (Triple.getEnvironment()) {
case llvm::Triple::Cygnus:
@@ -257,8 +254,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
return std::make_unique<NetBSDTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
case llvm::Triple::RTEMS:
return std::make_unique<RTEMSTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
case llvm::Triple::NaCl:
return std::make_unique<NaClTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
default:
return std::make_unique<ARMbeTargetInfo>(Triple, Opts);
}
@@ -301,9 +296,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
return std::make_unique<FreeBSDTargetInfo<MipsTargetInfo>>(Triple, Opts);
case llvm::Triple::NetBSD:
return std::make_unique<NetBSDTargetInfo<MipsTargetInfo>>(Triple, Opts);
case llvm::Triple::NaCl:
return std::make_unique<NaClTargetInfo<NaClMips32TargetInfo>>(Triple,
Opts);
case llvm::Triple::Win32:
switch (Triple.getEnvironment()) {
case llvm::Triple::GNU:
@@ -585,8 +577,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
return std::make_unique<HaikuX86_32TargetInfo>(Triple, Opts);
case llvm::Triple::RTEMS:
return std::make_unique<RTEMSX86_32TargetInfo>(Triple, Opts);
case llvm::Triple::NaCl:
return std::make_unique<NaClTargetInfo<X86_32TargetInfo>>(Triple, Opts);
case llvm::Triple::ELFIAMCU:
return std::make_unique<MCUX86_32TargetInfo>(Triple, Opts);
case llvm::Triple::Hurd:
@@ -646,8 +636,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
}
case llvm::Triple::Haiku:
return std::make_unique<HaikuTargetInfo<X86_64TargetInfo>>(Triple, Opts);
case llvm::Triple::NaCl:
return std::make_unique<NaClTargetInfo<X86_64TargetInfo>>(Triple, Opts);
case llvm::Triple::PS4:
return std::make_unique<PS4OSTargetInfo<X86_64TargetInfo>>(Triple, Opts);
case llvm::Triple::PS5:
3 changes: 0 additions & 3 deletions clang/lib/Basic/Targets/ARM.cpp
Original file line number Diff line number Diff line change
@@ -58,9 +58,6 @@ void ARMTargetInfo::setABIAAPCS() {
"-a:0:32"
"-n32"
"-S64");
} else if (T.isOSNaCl()) {
assert(!BigEndian && "NaCl on ARM does not support big endian");
resetDataLayout("e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S128");
} else {
resetDataLayout(BigEndian
? "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
47 changes: 0 additions & 47 deletions clang/lib/Basic/Targets/OSTargets.h
Original file line number Diff line number Diff line change
@@ -842,53 +842,6 @@ class LLVM_LIBRARY_VISIBILITY WindowsTargetInfo : public OSTargetInfo<Target> {
}
};

template <typename Target>
class LLVM_LIBRARY_VISIBILITY NaClTargetInfo : public OSTargetInfo<Target> {
protected:
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
MacroBuilder &Builder) const override {
if (Opts.POSIXThreads)
Builder.defineMacro("_REENTRANT");
if (Opts.CPlusPlus)
Builder.defineMacro("_GNU_SOURCE");

DefineStd(Builder, "unix", Opts);
Builder.defineMacro("__native_client__");
}

public:
NaClTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: OSTargetInfo<Target>(Triple, Opts) {
this->LongAlign = 32;
this->LongWidth = 32;
this->PointerAlign = 32;
this->PointerWidth = 32;
this->IntMaxType = TargetInfo::SignedLongLong;
this->Int64Type = TargetInfo::SignedLongLong;
this->DoubleAlign = 64;
this->LongDoubleWidth = 64;
this->LongDoubleAlign = 64;
this->LongLongWidth = 64;
this->LongLongAlign = 64;
this->SizeType = TargetInfo::UnsignedInt;
this->PtrDiffType = TargetInfo::SignedInt;
this->IntPtrType = TargetInfo::SignedInt;
// RegParmMax is inherited from the underlying architecture.
this->LongDoubleFormat = &llvm::APFloat::IEEEdouble();
if (Triple.getArch() == llvm::Triple::arm) {
// Handled in ARM's setABI().
} else if (Triple.getArch() == llvm::Triple::x86) {
this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
"i64:64-i128:128-n8:16:32-S128");
} else if (Triple.getArch() == llvm::Triple::x86_64) {
this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
"i64:64-i128:128-n8:16:32:64-S128");
} else if (Triple.getArch() == llvm::Triple::mipsel) {
// Handled on mips' setDataLayout.
}
}
};

// Fuchsia Target
template <typename Target>
class LLVM_LIBRARY_VISIBILITY FuchsiaTargetInfo : public OSTargetInfo<Target> {
29 changes: 0 additions & 29 deletions clang/lib/Basic/Targets/PNaCl.cpp

This file was deleted.

90 changes: 0 additions & 90 deletions clang/lib/Basic/Targets/PNaCl.h

This file was deleted.

1 change: 0 additions & 1 deletion clang/lib/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -142,7 +142,6 @@ add_clang_library(clangCodeGen
Targets/MSP430.cpp
Targets/Mips.cpp
Targets/NVPTX.cpp
Targets/PNaCl.cpp
Targets/PPC.cpp
Targets/RISCV.cpp
Targets/SPIR.cpp
4 changes: 1 addition & 3 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
@@ -118,9 +118,7 @@ createTargetCodeGenInfo(CodeGenModule &CGM) {
return createM68kTargetCodeGenInfo(CGM);
case llvm::Triple::mips:
case llvm::Triple::mipsel:
if (Triple.getOS() == llvm::Triple::NaCl)
return createPNaClTargetCodeGenInfo(CGM);
else if (Triple.getOS() == llvm::Triple::Win32)
if (Triple.getOS() == llvm::Triple::Win32)
return createWindowsMIPSTargetCodeGenInfo(CGM, /*IsOS32=*/true);
return createMIPSTargetCodeGenInfo(CGM, /*IsOS32=*/true);

3 changes: 0 additions & 3 deletions clang/lib/CodeGen/TargetInfo.h
Original file line number Diff line number Diff line change
@@ -533,9 +533,6 @@ createMSP430TargetCodeGenInfo(CodeGenModule &CGM);
std::unique_ptr<TargetCodeGenInfo>
createNVPTXTargetCodeGenInfo(CodeGenModule &CGM);

std::unique_ptr<TargetCodeGenInfo>
createPNaClTargetCodeGenInfo(CodeGenModule &CGM);

enum class PPC64_SVR4_ABIKind {
ELFv1 = 0,
ELFv2,
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.