Skip to content

Commit

Permalink
Expand list of known compiler built-ins
Browse files Browse the repository at this point in the history
Generated using `clang_builtins.py` after fixing the script as included
in this commit.
tautschnig committed Jun 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8c229d7 commit 8f85cb3
Showing 10 changed files with 2,136 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -44,6 +44,9 @@ src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-3.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-4.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-5.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-6.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-7.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-8.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-9.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_ia32.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_math.inc
src/ansi-c/compiler_headers/gcc_builtin_headers_mem_string.inc
6 changes: 6 additions & 0 deletions src/ansi-c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -72,6 +72,9 @@ make_inc(compiler_headers/gcc_builtin_headers_ia32-3)
make_inc(compiler_headers/gcc_builtin_headers_ia32-4)
make_inc(compiler_headers/gcc_builtin_headers_ia32-5)
make_inc(compiler_headers/gcc_builtin_headers_ia32-6)
make_inc(compiler_headers/gcc_builtin_headers_ia32-7)
make_inc(compiler_headers/gcc_builtin_headers_ia32-8)
make_inc(compiler_headers/gcc_builtin_headers_ia32-9)
make_inc(compiler_headers/gcc_builtin_headers_math)
make_inc(compiler_headers/gcc_builtin_headers_mem_string)
make_inc(compiler_headers/gcc_builtin_headers_mips)
@@ -95,6 +98,9 @@ set(extra_dependencies
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-4.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-5.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-6.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-7.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-8.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32-9.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_ia32.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_math.inc
${CMAKE_CURRENT_BINARY_DIR}/compiler_headers/gcc_builtin_headers_mem_string.inc
3 changes: 3 additions & 0 deletions src/ansi-c/Makefile
Original file line number Diff line number Diff line change
@@ -77,6 +77,9 @@ BUILTIN_FILES = \
compiler_headers/gcc_builtin_headers_ia32-4.inc \
compiler_headers/gcc_builtin_headers_ia32-5.inc \
compiler_headers/gcc_builtin_headers_ia32-6.inc \
compiler_headers/gcc_builtin_headers_ia32-7.inc \
compiler_headers/gcc_builtin_headers_ia32-8.inc \
compiler_headers/gcc_builtin_headers_ia32-9.inc \
compiler_headers/gcc_builtin_headers_ia32.inc \
compiler_headers/gcc_builtin_headers_math.inc \
compiler_headers/gcc_builtin_headers_mem_string.inc \
9 changes: 9 additions & 0 deletions src/ansi-c/ansi_c_internal_additions.cpp
Original file line number Diff line number Diff line change
@@ -70,6 +70,15 @@ const char gcc_builtin_headers_ia32_5[] =
const char gcc_builtin_headers_ia32_6[] =
#include "compiler_headers/gcc_builtin_headers_ia32-6.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_7[] =
#include "compiler_headers/gcc_builtin_headers_ia32-7.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_8[] =
#include "compiler_headers/gcc_builtin_headers_ia32-8.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
const char gcc_builtin_headers_ia32_9[] =
#include "compiler_headers/gcc_builtin_headers_ia32-9.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)

const char gcc_builtin_headers_alpha[] =
"#line 1 \"gcc_builtin_headers_alpha.h\"\n"
3 changes: 3 additions & 0 deletions src/ansi-c/ansi_c_internal_additions.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,9 @@ extern const char gcc_builtin_headers_ia32_3[];
extern const char gcc_builtin_headers_ia32_4[];
extern const char gcc_builtin_headers_ia32_5[];
extern const char gcc_builtin_headers_ia32_6[];
extern const char gcc_builtin_headers_ia32_7[];
extern const char gcc_builtin_headers_ia32_8[];
extern const char gcc_builtin_headers_ia32_9[];
extern const char gcc_builtin_headers_alpha[];
extern const char gcc_builtin_headers_arm[];
extern const char gcc_builtin_headers_mips[];
9 changes: 9 additions & 0 deletions src/ansi-c/builtin_factory.cpp
Original file line number Diff line number Diff line change
@@ -185,6 +185,15 @@ bool builtin_factory(

if(find_pattern(pattern, gcc_builtin_headers_ia32_6, s))
return convert(identifier, s, symbol_table, mh);

if(find_pattern(pattern, gcc_builtin_headers_ia32_7, s))
return convert(identifier, s, symbol_table, mh);

Check warning on line 190 in src/ansi-c/builtin_factory.cpp

Codecov / codecov/patch

src/ansi-c/builtin_factory.cpp#L190

Added line #L190 was not covered by tests

if(find_pattern(pattern, gcc_builtin_headers_ia32_8, s))
return convert(identifier, s, symbol_table, mh);

Check warning on line 193 in src/ansi-c/builtin_factory.cpp

Codecov / codecov/patch

src/ansi-c/builtin_factory.cpp#L193

Added line #L193 was not covered by tests

if(find_pattern(pattern, gcc_builtin_headers_ia32_9, s))
return convert(identifier, s, symbol_table, mh);

Check warning on line 196 in src/ansi-c/builtin_factory.cpp

Codecov / codecov/patch

src/ansi-c/builtin_factory.cpp#L196

Added line #L196 was not covered by tests
}
else if(config.ansi_c.arch=="arm64" ||
config.ansi_c.arch=="armel" ||
5 changes: 5 additions & 0 deletions src/ansi-c/compiler_headers/clang_builtins.py
Original file line number Diff line number Diff line change
@@ -115,6 +115,11 @@
2: '__gcc_v2df',
4: '__gcc_v4df',
8: '__gcc_v8df'
},
'__bf16': {
8: '__gcc_v8hf',
16: '__gcc_v16hf',
32: '__gcc_v32hf'
}
}

787 changes: 787 additions & 0 deletions src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-7.h

Large diffs are not rendered by default.

807 changes: 807 additions & 0 deletions src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-8.h

Large diffs are not rendered by default.

504 changes: 504 additions & 0 deletions src/ansi-c/compiler_headers/gcc_builtin_headers_ia32-9.h

Large diffs are not rendered by default.

0 comments on commit 8f85cb3

Please sign in to comment.