Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: lib/CodeGen/TargetInfo.cpp

Issue 1696583002: Remove Emscripten support (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/CodeGen/ItaniumCXXABI.cpp ('k') | lib/Driver/Driver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/CodeGen/TargetInfo.cpp
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index df6192490589784a999657e12c8e7d69782b940d..d27c375fa97ffea38861a8779d91606351a6c9da 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -432,63 +432,6 @@ ABIArgInfo DefaultABIInfo::classifyReturnType(QualType RetTy) const {
ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
}
-// @LOCALMOD-START Emscripten
-//===----------------------------------------------------------------------===//
-// Emscripten ABI Implementation
-//
-// This is a very simple ABI that relies a lot on DefaultABIInfo.
-//===----------------------------------------------------------------------===//
-
-class EmscriptenABIInfo : public DefaultABIInfo {
-public:
- explicit EmscriptenABIInfo(CodeGen::CodeGenTypes &CGT)
- : DefaultABIInfo(CGT) {}
-
- ABIArgInfo classifyReturnType(QualType RetTy) const;
- ABIArgInfo classifyArgumentType(QualType Ty) const;
-
- // DefaultABIInfo's classifyReturnType and classifyArgumentType are
- // non-virtual, but computeInfo is virtual, so we overload that.
- void computeInfo(CGFunctionInfo &FI) const override {
- FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
- for (auto &Arg : FI.arguments())
- Arg.info = classifyArgumentType(Arg.type);
- }
-};
-
-class EmscriptenTargetCodeGenInfo : public TargetCodeGenInfo {
-public:
- explicit EmscriptenTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT)
- : TargetCodeGenInfo(new EmscriptenABIInfo(CGT)) {}
-};
-
-/// \brief Classify argument of given type \p Ty.
-ABIArgInfo EmscriptenABIInfo::classifyArgumentType(QualType Ty) const {
- if (isAggregateTypeForABI(Ty)) {
- unsigned TypeAlign = getContext().getTypeAlignInChars(Ty).getQuantity();
- if (auto RAA = getRecordArgABI(Ty, getCXXABI()))
- return ABIArgInfo::getIndirect(TypeAlign,
- RAA == CGCXXABI::RAA_DirectInMemory);
- return ABIArgInfo::getIndirect(TypeAlign);
- }
-
- // Otherwise just do the default thing.
- return DefaultABIInfo::classifyArgumentType(Ty);
-}
-
-ABIArgInfo EmscriptenABIInfo::classifyReturnType(QualType RetTy) const {
- if (isAggregateTypeForABI(RetTy)) {
- // As an optimization, lower single-element structs to just return a regular
- // value.
- if (const Type *SeltTy = isSingleElementStruct(RetTy, getContext()))
- return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0)));
- }
-
- // Otherwise just do the default thing.
- return DefaultABIInfo::classifyReturnType(RetTy);
-}
-// @LOCALMOD-END Emscripten
-
//===----------------------------------------------------------------------===//
// le32/PNaCl bitcode ABI Implementation
//
@@ -7046,11 +6989,6 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
default:
return *(TheTargetCodeGenInfo = new DefaultTargetCodeGenInfo(Types));
- // @LOCALMOD-START Emscripten
- case llvm::Triple::asmjs:
- return *(TheTargetCodeGenInfo = new EmscriptenTargetCodeGenInfo(Types));
- // @LOCALMOD-END Emscripten
-
case llvm::Triple::le32:
return *(TheTargetCodeGenInfo = new PNaClTargetCodeGenInfo(Types));
case llvm::Triple::mips:
« no previous file with comments | « lib/CodeGen/ItaniumCXXABI.cpp ('k') | lib/Driver/Driver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698