[PATCH] D19854: Define Contiki OS toolchain
Michael LeMay via cfe-commits
cfe-commits at lists.llvm.org
Mon May 2 22:30:06 PDT 2016
mlemay-intel created this revision.
mlemay-intel added reviewers: pcc, eugenis.
mlemay-intel added a subscriber: cfe-commits.
It is defined with support for the SafeStack sanitizer on x86.
http://reviews.llvm.org/D19854
Files:
lib/Driver/Driver.cpp
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
Index: lib/Driver/ToolChains.h
===================================================================
--- lib/Driver/ToolChains.h
+++ lib/Driver/ToolChains.h
@@ -1175,6 +1175,14 @@
Tool *buildLinker() const override;
};
+class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF {
+public:
+ Contiki(const Driver &D, const llvm::Triple &Triple,
+ const llvm::opt::ArgList &Args);
+
+ SanitizerMask getSupportedSanitizers() const override;
+};
+
} // end namespace toolchains
} // end namespace driver
} // end namespace clang
Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4624,3 +4624,14 @@
Res |= SanitizerKind::Vptr;
return Res;
}
+
+Contiki::Contiki(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ : Generic_ELF(D, Triple, Args) {}
+
+SanitizerMask Contiki::getSupportedSanitizers() const {
+ const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
+ SanitizerMask Res = ToolChain::getSupportedSanitizers();
+ if (IsX86)
+ Res |= SanitizerKind::SafeStack;
+ return Res;
+}
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -2499,6 +2499,9 @@
case llvm::Triple::PS4:
TC = new toolchains::PS4CPU(*this, Target, Args);
break;
+ case llvm::Triple::Contiki:
+ TC = new toolchains::Contiki(*this, Target, Args);
+ break;
default:
// Of these targets, Hexagon is the only one that might have
// an OS of Linux, in which case it got handled above already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19854.55945.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160503/0f7040d1/attachment.bin>
More information about the cfe-commits
mailing list