[cfe-commits] [Patch] Add suppor for Bitrig, an OpenBSD fork.
Brad Smith
brad at comstyle.com
Mon Aug 6 19:50:55 PDT 2012
On Mon, Aug 06, 2012 at 10:28:37PM -0400, David Hill wrote:
> Attached is a diff to add support for Bitrig, an OpenBSD fork.
>
> Please review.
>
> Thanks,
> David
> +// Bitrig Target
> +template<typename Target>
> +class BitrigTargetInfo : public OSTargetInfo<Target> {
> +protected:
> + virtual void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
> + MacroBuilder &Builder) const {
> + // Bitrig defines; list based off of gcc output
> +
> + Builder.defineMacro("__Bitrig__");
> + DefineStd(Builder, "unix", Opts);
> + Builder.defineMacro("__ELF__");
> + if (Opts.POSIXThreads)
> + Builder.defineMacro("_REENTRANT");
> + }
> +public:
> + BitrigTargetInfo(const std::string &triple)
> + : OSTargetInfo<Target>(triple) {
> + this->UserLabelPrefix = "";
> + this->TLSSupported = false;
> +
> + llvm::Triple Triple(triple);
> + switch (Triple.getArch()) {
> + case llvm::Triple::sparcv9:
> + this->MCountName = "_mcount";
> + break;
> + default:
> + this->MCountName = "__mcount";
> + break;
> + }
> + }
> +};
Since there is no SPARC64 target for Bitrig this can be
simplified by just putting ``this->MCountName = "__mcount";''
below ``this->TLSSupported'' and eliminating the rest.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the cfe-commits
mailing list