зеркало из https://github.com/microsoft/clang-1.git
Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS X
and linux. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c8ff915c4b
Коммит
4c7ce36a76
|
@ -1806,7 +1806,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
|||
Opts.NoBitFieldTypeAlign = Args.hasArg(OPT_fno_bitfield_type_align);
|
||||
Opts.SinglePrecisionConstants = Args.hasArg(OPT_cl_single_precision_constant);
|
||||
Opts.FastRelaxedMath = Args.hasArg(OPT_cl_fast_relaxed_math);
|
||||
Opts.OptimizeSize = 0;
|
||||
Opts.MRTD = Args.hasArg(OPT_mrtd);
|
||||
Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map);
|
||||
Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype);
|
||||
|
@ -1823,6 +1822,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
|||
// FIXME: Eliminate this dependency.
|
||||
unsigned Opt = getOptimizationLevel(Args, IK, Diags);
|
||||
Opts.Optimize = Opt != 0;
|
||||
Opts.OptimizeSize = Args.hasArg(OPT_Os) || Args.hasArg(OPT_Oz);
|
||||
|
||||
// This is the __NO_INLINE__ define, which just depends on things like the
|
||||
// optimization level and -fno-inline, not actually whether the backend has
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#ifndef __OPTIMIZE__
|
||||
#error "__OPTIMIZE__ not defined"
|
||||
#endif
|
||||
#ifdef __OPTIMIZE_SIZE__
|
||||
#ifndef __OPTIMIZE_SIZE__
|
||||
#error "__OPTIMIZE_SIZE__ not defined"
|
||||
#endif
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче