summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2015-07-08 13:07:31 +0000
committerPetar Jovanovic <petar.jovanovic@imgtec.com>2015-07-08 13:07:31 +0000
commit26a4a40137dc8cc5c9855c76994ee39a58dc19bd (patch)
tree1e716a312d6c363964d585276057df3b5ebba3d4 /clang/lib/Basic
parentfb1662f563c841058464529125a3e07570e3c61d (diff)
downloadbcm5719-llvm-26a4a40137dc8cc5c9855c76994ee39a58dc19bd.tar.gz
bcm5719-llvm-26a4a40137dc8cc5c9855c76994ee39a58dc19bd.zip
[MIPS] Add support for direct-to-nacl in Clang
For Mips direct-to-nacl, the goal is to be close to le32 front-end and use Mips32EL backend. This patch defines new NaClMips32ELTargetInfo and modifies it slightly to be close to le32. It also adds necessary parts, inline with ARM and X86. Differential Revision: http://reviews.llvm.org/D10739 llvm-svn: 241678
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index db0036721d2..f3f9e38c22f 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -6672,6 +6672,19 @@ void PNaClTargetInfo::getGCCRegAliases(const GCCRegAlias *&Aliases,
NumAliases = 0;
}
+// We attempt to use PNaCl (le32) frontend and Mips32EL backend.
+class NaClMips32ELTargetInfo : public Mips32ELTargetInfo {
+public:
+ NaClMips32ELTargetInfo(const llvm::Triple &Triple) :
+ Mips32ELTargetInfo(Triple) {
+ MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0;
+ }
+
+ BuiltinVaListKind getBuiltinVaListKind() const override {
+ return TargetInfo::PNaClABIBuiltinVaList;
+ }
+};
+
class Le64TargetInfo : public TargetInfo {
static const Builtin::Info BuiltinInfo[];
@@ -7042,7 +7055,7 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
case llvm::Triple::NetBSD:
return new NetBSDTargetInfo<Mips32ELTargetInfo>(Triple);
case llvm::Triple::NaCl:
- return new NaClTargetInfo<Mips32ELTargetInfo>(Triple);
+ return new NaClTargetInfo<NaClMips32ELTargetInfo>(Triple);
default:
return new Mips32ELTargetInfo(Triple);
}
OpenPOWER on IntegriCloud