aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2020-03-14 18:55:13 +0100
committerAyke van Laethem <aykevanlaethem@gmail.com>2020-03-17 13:21:03 +0100
commit4add24920550beeaed15b24e6427154a58b02e50 (patch)
treec1f545da2b13e69611ce0e2fbc4401d9349dd489 /clang/lib/Frontend/CompilerInvocation.cpp
parent0818e6cf1d30dcac1fc4dcde60e01f8389e725f9 (diff)
downloadllvm-4add24920550beeaed15b24e6427154a58b02e50.zip
llvm-4add24920550beeaed15b24e6427154a58b02e50.tar.gz
llvm-4add24920550beeaed15b24e6427154a58b02e50.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
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;