Skip to content

Commit e89b1f2

Browse files
authored
Merge pull request #28 from schweitzpgi/master
master -merge latest changes from clang
2 parents f783487 + da95ba6 commit e89b1f2

File tree

837 files changed

+45230
-25998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

837 files changed

+45230
-25998
lines changed

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ if (CLANG_ENABLE_BOOTSTRAP)
583583
endif()
584584
endif()
585585

586+
if(CLANG_BOOTSTRAP_EXTRA_DEPS)
587+
add_dependencies(clang-bootstrap-deps ${CLANG_BOOTSTRAP_EXTRA_DEPS})
588+
endif()
589+
586590
add_custom_target(${NEXT_CLANG_STAGE}-clear
587591
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${NEXT_CLANG_STAGE}-cleared
588592
)
@@ -617,10 +621,15 @@ if (CLANG_ENABLE_BOOTSTRAP)
617621
LLVM_ENABLE_PROJECTS
618622
LLVM_ENABLE_RUNTIMES)
619623

620-
# We don't need to depend on compiler-rt if we're building instrumented
624+
# We don't need to depend on compiler-rt/libcxx if we're building instrumented
621625
# because the next stage will use the same compiler used to build this stage.
622-
if(TARGET compiler-rt AND NOT LLVM_BUILD_INSTRUMENTED)
623-
add_dependencies(clang-bootstrap-deps compiler-rt)
626+
if(NOT LLVM_BUILD_INSTRUMENTED)
627+
if(TARGET compiler-rt)
628+
add_dependencies(clang-bootstrap-deps compiler-rt)
629+
endif()
630+
if(TARGET cxx-headers)
631+
add_dependencies(clang-bootstrap-deps cxx-headers)
632+
endif()
624633
endif()
625634

626635
set(C_COMPILER "clang")
@@ -749,6 +758,7 @@ endif()
749758
if (LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
750759
add_subdirectory(utils/ClangVisualizers)
751760
endif()
761+
add_subdirectory(utils/hmaptool)
752762

753763
configure_file(
754764
${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake

LICENSE.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LLVM Release License
44
University of Illinois/NCSA
55
Open Source License
66

7-
Copyright (c) 2007-2016 University of Illinois at Urbana-Champaign.
7+
Copyright (c) 2007-2018 University of Illinois at Urbana-Champaign.
88
All rights reserved.
99

1010
Developed by:

bindings/python/tests/cindex/test_cdb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
import os
66
import gc
77
import unittest
8+
import sys
89

910

1011
kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
1112

1213

14+
@unittest.skipIf(sys.platform == 'win32', "TODO: Fix these tests on Windows")
1315
class TestCDB(unittest.TestCase):
1416
def test_create_fail(self):
1517
"""Check we fail loading a database with an assertion"""

bindings/python/tests/cindex/test_cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def test_enum_type(self):
335335

336336
self.assertEqual(enum.kind, CursorKind.ENUM_DECL)
337337
enum_type = enum.enum_type
338-
self.assertEqual(enum_type.kind, TypeKind.UINT)
338+
self.assertIn(enum_type.kind, (TypeKind.UINT, TypeKind.INT))
339339

340340
def test_enum_type_cpp(self):
341341
tu = get_tu('enum TEST : long long { FOO=1, BAR=2 };', lang="cpp")
@@ -561,4 +561,4 @@ def test_mangled_name(self):
561561
# all valid manglings.
562562
# [c-index-test handles this by running the source through clang, emitting
563563
# an AST file and running libclang on that AST file]
564-
self.assertIn(foo.mangled_name, ('_Z3fooii', '__Z3fooii', '?foo@@YAHHH'))
564+
self.assertIn(foo.mangled_name, ('_Z3fooii', '__Z3fooii', '?foo@@YAHHH', '?foo@@YAHHH@Z'))

bindings/python/tests/cindex/test_translation_unit.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from contextlib import contextmanager
12
import gc
23
import os
34
import tempfile
@@ -19,15 +20,15 @@
1920
kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
2021

2122

23+
@contextmanager
2224
def save_tu(tu):
2325
"""Convenience API to save a TranslationUnit to a file.
2426
2527
Returns the filename it was saved to.
2628
"""
27-
_, path = tempfile.mkstemp()
28-
tu.save(path)
29-
30-
return path
29+
with tempfile.NamedTemporaryFile() as t:
30+
tu.save(t.name)
31+
yield t.name
3132

3233

3334
class TestTranslationUnit(unittest.TestCase):
@@ -125,10 +126,9 @@ def test_save(self):
125126

126127
tu = get_tu('int foo();')
127128

128-
path = save_tu(tu)
129-
self.assertTrue(os.path.exists(path))
130-
self.assertGreater(os.path.getsize(path), 0)
131-
os.unlink(path)
129+
with save_tu(tu) as path:
130+
self.assertTrue(os.path.exists(path))
131+
self.assertGreater(os.path.getsize(path), 0)
132132

133133
def test_save_translation_errors(self):
134134
"""Ensure that saving to an invalid directory raises."""
@@ -149,21 +149,18 @@ def test_load(self):
149149

150150
tu = get_tu('int foo();')
151151
self.assertEqual(len(tu.diagnostics), 0)
152-
path = save_tu(tu)
153-
154-
self.assertTrue(os.path.exists(path))
155-
self.assertGreater(os.path.getsize(path), 0)
156-
157-
tu2 = TranslationUnit.from_ast_file(filename=path)
158-
self.assertEqual(len(tu2.diagnostics), 0)
152+
with save_tu(tu) as path:
153+
self.assertTrue(os.path.exists(path))
154+
self.assertGreater(os.path.getsize(path), 0)
159155

160-
foo = get_cursor(tu2, 'foo')
161-
self.assertIsNotNone(foo)
156+
tu2 = TranslationUnit.from_ast_file(filename=path)
157+
self.assertEqual(len(tu2.diagnostics), 0)
162158

163-
# Just in case there is an open file descriptor somewhere.
164-
del tu2
159+
foo = get_cursor(tu2, 'foo')
160+
self.assertIsNotNone(foo)
165161

166-
os.unlink(path)
162+
# Just in case there is an open file descriptor somewhere.
163+
del tu2
167164

168165
def test_index_parse(self):
169166
path = os.path.join(kInputsDir, 'hello.cpp')

cmake/caches/Fuchsia-stage2.cmake

Lines changed: 76 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
88
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
99
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
1010
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
11+
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
1112
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
1213
set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
1314
set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
@@ -27,69 +28,87 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
2728
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
2829
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
2930

30-
set(FUCHSIA_BUILTINS_BUILD_TYPE Release CACHE STRING "")
31-
set(FUCHSIA_RUNTIMES_BUILD_TYPE Release CACHE STRING "")
32-
set(FUCHSIA_RUNTIMES_ENABLE_ASSERTIONS ON CACHE BOOL "")
31+
if(APPLE)
32+
list(APPEND BUILTIN_TARGETS "default")
33+
list(APPEND RUNTIME_TARGETS "default")
34+
elseif(UNIX)
35+
foreach(target i386;x86_64;armhf;aarch64)
36+
if(LINUX_${target}_SYSROOT)
37+
# Set the per-target builtins options.
38+
list(APPEND BUILTIN_TARGETS "${target}-linux-gnu")
39+
set(BUILTINS_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
40+
set(BUILTINS_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
41+
set(BUILTINS_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
3342

34-
set(LLVM_BUILTIN_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
43+
# Set the per-target runtimes options.
44+
list(APPEND RUNTIME_TARGETS "${target}-linux-gnu")
45+
set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
46+
set(RUNTIMES_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
47+
set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
48+
set(RUNTIMES_${target}-linux-gnu_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
49+
set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
50+
set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
51+
set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
52+
set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
53+
set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
54+
set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
55+
set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
56+
set(RUNTIMES_${target}-linux-gnu_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
57+
set(RUNTIMES_${target}-linux-gnu_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
58+
set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
59+
set(RUNTIMES_${target}-linux-gnu_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
60+
endif()
61+
endforeach()
62+
endif()
3563

36-
# Set the per-target builtins options.
37-
foreach(target x86_64;aarch64)
38-
set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
39-
set(BUILTINS_${target}-fuchsia_CMAKE_BUILD_TYPE ${FUCHSIA_BUILTINS_BUILD_TYPE} CACHE STRING "")
40-
set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_C_FLAGS} CACHE PATH "")
41-
set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_C_FLAGS} CACHE PATH "")
42-
set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_CXX_FLAGS} CACHE PATH "")
43-
set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
44-
set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
45-
set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
46-
set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
47-
endforeach()
64+
if(FUCHSIA_SDK)
65+
set(FUCHSIA_aarch64_NAME arm64)
66+
set(FUCHSIA_x86_64_NAME x64)
67+
foreach(target x86_64;aarch64)
68+
set(FUCHSIA_${target}_COMPILER_FLAGS "-I${FUCHSIA_SDK}/pkg/fdio/include")
69+
set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
70+
set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
71+
endforeach()
4872

49-
set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia" CACHE STRING "")
73+
foreach(target x86_64;aarch64)
74+
# Set the per-target builtins options.
75+
list(APPEND BUILTIN_TARGETS "${target}-fuchsia")
76+
set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
77+
set(BUILTINS_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
78+
set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
79+
set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
80+
set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
81+
set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
82+
set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
83+
set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
84+
set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
5085

51-
# Set the default target runtimes options.
52-
if(NOT APPLE)
53-
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
54-
set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
55-
set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
56-
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
57-
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
58-
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
59-
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
60-
set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
61-
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
62-
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
63-
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
64-
endif()
86+
# Set the per-target runtimes options.
87+
list(APPEND RUNTIME_TARGETS "${target}-fuchsia")
88+
set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
89+
set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
90+
set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE STRING "")
91+
set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
92+
set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
93+
set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
94+
set(RUNTIMES_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
95+
set(RUNTIMES_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
96+
set(RUNTIMES_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
97+
set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
98+
set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
99+
set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
100+
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
101+
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
102+
set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
103+
set(RUNTIMES_${target}-fuchsia_SANITIZER_USE_COMPILER_RT ON CACHE BOOL "")
104+
endforeach()
65105

66-
# Set the per-target runtimes options.
67-
foreach(target x86_64;aarch64)
68-
set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
69-
set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_TYPE ${FUCHSIA_RUNTIMES_BUILD_TYPE} CACHE STRING "")
70-
set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE STRING "")
71-
set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_C_FLAGS} CACHE PATH "")
72-
set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_C_FLAGS} CACHE PATH "")
73-
set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_CXX_FLAGS} CACHE PATH "")
74-
set(RUNTIMES_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
75-
set(RUNTIMES_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
76-
set(RUNTIMES_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
77-
set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
78-
set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ${FUCHSIA_RUNTIMES_ENABLE_ASSERTIONS} CACHE BOOL "")
79-
set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
80-
set(RUNTIMES_${target}-fuchsia_LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "")
81-
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
82-
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
83-
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_ENABLE_STATIC OFF CACHE BOOL "")
84-
set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
85-
set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
86-
set(RUNTIMES_${target}-fuchsia_SANITIZER_USE_COMPILER_RT ON CACHE BOOL "")
106+
set(LLVM_RUNTIME_SANITIZERS "Address" CACHE STRING "")
107+
set(LLVM_RUNTIME_SANITIZER_Address_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
108+
endif()
87109

88-
set(RUNTIMES_${target}-fuchsia-asan_LLVM_USE_SANITIZER Address CACHE STRING "")
89-
set(RUNTIMES_${target}-fuchsia-asan_LLVM_RUNTIMES_PREFIX "${target}-fuchsia/" CACHE STRING "")
90-
set(RUNTIMES_${target}-fuchsia-asan_LLVM_RUNTIMES_LIBDIR_SUFFIX "/asan" CACHE STRING "")
91-
set(RUNTIMES_${target}-fuchsia-asan_LIBCXX_INSTALL_HEADERS OFF CACHE BOOL "")
92-
endforeach()
110+
set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "")
111+
set(LLVM_RUNTIME_TARGETS "${RUNTIME_TARGETS}" CACHE STRING "")
93112

94113
# Setup toolchain.
95114
set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")

cmake/caches/Fuchsia.cmake

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
77
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
88
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
99
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
10-
set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "")
1110
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
11+
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
1212
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
1313
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
14+
set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "")
1415
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
1516

1617
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
@@ -21,10 +22,25 @@ if(NOT APPLE)
2122
set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
2223
endif()
2324

25+
set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
26+
set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
27+
2428
if(APPLE)
2529
set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
2630
set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
2731
set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
32+
elseif(UNIX)
33+
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
34+
set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
35+
set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
36+
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
37+
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
38+
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
39+
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
40+
set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
41+
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
42+
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
43+
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
2844
endif()
2945

3046
set(CLANG_BOOTSTRAP_TARGETS
@@ -51,6 +67,10 @@ endforeach()
5167

5268
# Setup the bootstrap build.
5369
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
70+
set(CLANG_BOOTSTRAP_EXTRA_DEPS
71+
builtins
72+
runtimes
73+
CACHE STRING "")
5474
set(CLANG_BOOTSTRAP_CMAKE_ARGS
5575
${EXTRA_ARGS}
5676
-C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake

docs/AddressSanitizer.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,17 @@ this purpose.
197197
Disabling Instrumentation with ``__attribute__((no_sanitize("address")))``
198198
--------------------------------------------------------------------------
199199

200-
Some code should not be instrumented by AddressSanitizer. One may use the
201-
function attribute ``__attribute__((no_sanitize("address")))`` (which has
202-
deprecated synonyms `no_sanitize_address` and `no_address_safety_analysis`) to
203-
disable instrumentation of a particular function. This attribute may not be
204-
supported by other compilers, so we suggest to use it together with
200+
Some code should not be instrumented by AddressSanitizer. One may use
201+
the attribute ``__attribute__((no_sanitize("address")))`` (which has
202+
deprecated synonyms `no_sanitize_address` and
203+
`no_address_safety_analysis`) to disable instrumentation of a
204+
particular function. This attribute may not be supported by other
205+
compilers, so we suggest to use it together with
205206
``__has_feature(address_sanitizer)``.
206207

208+
The same attribute used on a global variable prevents AddressSanitizer
209+
from adding redzones around it and detecting out of bounds accesses.
210+
207211
Suppressing Errors in Recompiled Code (Blacklist)
208212
-------------------------------------------------
209213

docs/ClangCommandLineReference.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,12 @@ Set the default symbol visibility for all global declarations
19341934

19351935
Enables whole-program vtable optimization. Requires -flto
19361936

1937+
.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1938+
1939+
In order to improve devirtualization, forces emitting of vtables even in
1940+
modules where it isn't necessary. It causes more inline virtual functions
1941+
to be emitted.
1942+
19371943
.. option:: -fwrapv, -fno-wrapv
19381944

19391945
Treat signed integer overflow as two's complement
@@ -2296,6 +2302,10 @@ AARCH64
22962302

22972303
Reserve the x18 register (AArch64 only)
22982304

2305+
.. option:: -ffixed-x20
2306+
2307+
Reserve the x20 register (AArch64 only)
2308+
22992309
.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
23002310

23012311
Workaround Cortex-A53 erratum 835769 (AArch64 only)

0 commit comments

Comments
 (0)