diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/Targets.cpp | 13 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 31 |
2 files changed, 22 insertions, 22 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 91ecf475e6..07c9e37d1c 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -160,9 +160,6 @@ static void GetDarwinLanguageOptions(LangOptions &Opts, const llvm::Triple &Triple) { Opts.NeXTRuntime = true; - if (Triple.getOS() != llvm::Triple::Darwin) - return; - unsigned MajorVersion = Triple.getDarwinMajorNumber(); // Blocks and stack protectors default to on for 10.6 (darwin10) and beyond. @@ -192,7 +189,6 @@ protected: /// various language options. These may be overridden by command line /// options. virtual void getDefaultLangOptions(LangOptions &Opts) { - TargetInfo::getDefaultLangOptions(Opts); GetDarwinLanguageOptions(Opts, TargetInfo::getTriple()); } public: @@ -436,10 +432,6 @@ public: return true; } } - virtual void getDefaultLangOptions(LangOptions &Opts) { - TargetInfo::getDefaultLangOptions(Opts); - Opts.CharIsSigned = false; - } virtual const char *getClobbers() const { return ""; } @@ -1676,11 +1668,6 @@ namespace { NumRecords = 0; } - virtual void getDefaultLangOptions(LangOptions &Opts) { - TargetInfo::getDefaultLangOptions(Opts); - Opts.CharIsSigned = false; - } - virtual void getGCCRegNames(const char * const *&Names, unsigned &NumNames) const; virtual void getGCCRegAliases(const GCCRegAlias *&Aliases, diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 657ebee924..d5088fe7b3 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -321,6 +321,23 @@ static std::string getLLVMTriple(const ToolChain &TC, const ArgList &Args) { } } +// FIXME: Move to target hook. +static bool isSignedCharDefault(const llvm::Triple &Triple) { + switch (Triple.getArch()) { + default: + return true; + + case llvm::Triple::ppc: + case llvm::Triple::ppc64: + if (Triple.getOS() == llvm::Triple::Darwin) + return true; + return false; + + case llvm::Triple::systemz: + return false; + } +} + void Clang::AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { const Driver &D = getToolChain().getHost().getDriver(); @@ -927,15 +944,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (!Args.hasFlag(options::OPT_frtti, options::OPT_fno_rtti)) CmdArgs.push_back("-frtti=0"); - // -fsigned-char/-funsigned-char default varies depending on platform; only - // pass if specified. - if (Arg *A = Args.getLastArg(options::OPT_fsigned_char, - options::OPT_funsigned_char)) { - if (A->getOption().matches(options::OPT_fsigned_char)) - CmdArgs.push_back("-fsigned-char"); - else - CmdArgs.push_back("-fsigned-char=0"); - } + // -fsigned-char is default. + if (!Args.hasFlag(options::OPT_fsigned_char, + options::OPT_funsigned_char, + isSignedCharDefault(getToolChain().getTriple()))) + CmdArgs.push_back("-fsigned-char=0"); // -fshort-wchar default varies depending on platform; only // pass if specified. |