https://llvm.org/bugs/show_bug.cgi?id=31530
Bug ID: 31530 Summary: UINT16_TYPE and INT16_TYPE are defined as short instead of int for AVR Product: clang Version: unspecified Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: LLVM Codegen Assignee: unassignedclangb...@nondot.org Reporter: dylanmcka...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified UINT16_TYPE and INT16_TYPE are implicitly defined by the preprocessor to the short type, rather than int. While shorts and ints are both 16 bits wide on the avr, gcc picks ints to represent 16 bits wherever possible, and picking short can cause issues with C++ name mangling (see https://reviews.llvm.org/D27123#615854). Therefore, clang should define the two types to short. Clang's lib/Frontend/InitPreprocessor.cpp::DefineExactWidthIntType does not use TargetInfo::getIntTypeByWidth. Instead, InitializePredefinedMacros calls the function with the specific type (SignedShort/UnsignedShort), because getShortWidth() > getCharWidth(), but getIntWidth() == getShortWidth(). -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs