From 4add24920550beeaed15b24e6427154a58b02e50 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 14 Mar 2020 18:55:13 +0100 Subject: [AVR] Add support for the -mdouble=x flag This flag is used by avr-gcc (starting with v10) to set the width of the double type. The double type is by default interpreted as a 32-bit floating point number in avr-gcc instead of a 64-bit floating point number as is common on other architectures. Starting with GCC 10, a new option has been added to control this behavior: https://gcc.gnu.org/wiki/avr-gcc#Deviations_from_the_Standard This commit keeps the default double at 32 bits but adds support for the -mdouble flag (-mdouble=32 and -mdouble=64) to control this behavior. Differential Revision: https://reviews.llvm.org/D76181 --- clang/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 08a0b98..e2b24f0 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2937,6 +2937,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.PackStruct = getLastArgIntValue(Args, OPT_fpack_struct_EQ, 0, Diags); Opts.MaxTypeAlign = getLastArgIntValue(Args, OPT_fmax_type_align_EQ, 0, Diags); Opts.AlignDouble = Args.hasArg(OPT_malign_double); + Opts.DoubleSize = getLastArgIntValue(Args, OPT_mdouble_EQ, 0, Diags); Opts.LongDoubleSize = Args.hasArg(OPT_mlong_double_128) ? 128 : Args.hasArg(OPT_mlong_double_64) ? 64 : 0; -- cgit v1.1