[PATCH] D27123: Add AVR target and toolchain to Clang

Jonathan Roelofs via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 7 07:39:51 PST 2016


jroelofs added a comment.

In https://reviews.llvm.org/D27123#615738, @saaadhu wrote:

> Thanks, setting DoubleFormat and LongDoubleFormat fixed the __DBL_ and __LDBL_ differences. Also, setting SigAtomicType fixed the __SIG_ATOMIC_ differences as well. I've added those defines to the test. Unrelated, but I also removed a redundant set of LongLongAlign and overriding of GetDefaultDwarfVersion (returning 2 wasn't necessary).
>
> The only remaining  (textually) conflicting defines between "avr-gcc -dM -E" and "clang -dM -E" are
>
> 1. short vs int for a bunch of __xxx_TYPE__ defines, like say __CHAR16_TYPE__. short and int are both 2 bytes for the avr, so I think either one is ok.


This will bite you when it comes to C++. Those two types are mangled differently, so you'll get an ABI mismatch in overloads that use those typedefs.

> 2. Casts vs plain literals in the defines for double MIN, MAX values.  avr-gcc, for example, defines #define __DBL_MAX__ ((double)3.40282347e+38L), whereas clang does  #define __DBL_MAX__ 3.40282347e+38. Again, I think this shouldn't matter - I've added the literals sans the cast to the test.

That should be fine.


https://reviews.llvm.org/D27123





More information about the cfe-commits mailing list