[PATCH] D100701: [clang][AVR] Redefine some types to be compatible with avr-gcc
Ben Shi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 12 07:06:03 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG892c56eabe25: [clang][AVR] Redefine some types to be compatible with avr-gcc (authored by benshi001).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100701/new/
https://reviews.llvm.org/D100701
Files:
clang/lib/Basic/Targets/AVR.cpp
clang/test/CodeGen/builtins.cpp
clang/test/Preprocessor/init.c
Index: clang/test/Preprocessor/init.c
===================================================================
--- clang/test/Preprocessor/init.c
+++ clang/test/Preprocessor/init.c
@@ -1942,7 +1942,7 @@
// AVR:#define __GXX_ABI_VERSION 1002
// AVR:#define __INT16_C_SUFFIX__
// AVR:#define __INT16_MAX__ 32767
-// AVR:#define __INT16_TYPE__ short
+// AVR:#define __INT16_TYPE__ int
// AVR:#define __INT32_C_SUFFIX__ L
// AVR:#define __INT32_MAX__ 2147483647L
// AVR:#define __INT32_TYPE__ long int
@@ -2017,7 +2017,7 @@
// AVR:#define __SIZE_TYPE__ unsigned int
// AVR:#define __STDC__ 1
// AVR:#define __UINT16_MAX__ 65535U
-// AVR:#define __UINT16_TYPE__ unsigned short
+// AVR:#define __UINT16_TYPE__ unsigned int
// AVR:#define __UINT32_C_SUFFIX__ UL
// AVR:#define __UINT32_MAX__ 4294967295UL
// AVR:#define __UINT32_TYPE__ long unsigned int
Index: clang/test/CodeGen/builtins.cpp
===================================================================
--- clang/test/CodeGen/builtins.cpp
+++ clang/test/CodeGen/builtins.cpp
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -ffreestanding -verify %s
// RUN: %clang_cc1 -std=c++11 -triple i686-pc-linux-gnu -ffreestanding -verify %s
-// RUN: %clang_cc1 -std=c++11 -triple avr-unknown-unknown -ffreestanding -verify %s
// expected-no-diagnostics
Index: clang/lib/Basic/Targets/AVR.cpp
===================================================================
--- clang/lib/Basic/Targets/AVR.cpp
+++ clang/lib/Basic/Targets/AVR.cpp
@@ -309,6 +309,8 @@
Builder.defineMacro("__AVR__");
Builder.defineMacro("__ELF__");
Builder.defineMacro("__flash", "__attribute__((address_space(1)))");
+ Builder.defineMacro("__UINT16_TYPE__", "unsigned int");
+ Builder.defineMacro("__INT16_TYPE__", "int");
if (!this->CPU.empty()) {
auto It = llvm::find_if(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100701.344812.patch
Type: text/x-patch
Size: 1841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210512/22b5703e/attachment-0001.bin>
More information about the cfe-commits
mailing list