Skip to content

Commit

Permalink
Merge from 'master' to 'sycl-web' (intel#275)
Browse files Browse the repository at this point in the history
  CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp
  • Loading branch information
sndmitriev committed Oct 11, 2019
2 parents 00489ec + 9f6a873 commit 2d5ba8e
Show file tree
Hide file tree
Showing 912 changed files with 31,730 additions and 8,177 deletions.
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ add_clang_library(clangTidyUtils
clangBasic
clangLex
clangTidy
clangToolingRefactoring
clangTransformer
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../utils/IncludeInserter.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Tooling/Refactoring/Transformer.h"
#include "clang/Tooling/Transformer/Transformer.h"
#include <deque>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro(create_clangd_xpc_framework target name)

# Copy the framework binary.
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${target}.dylib"
"$<TARGET_FILE:${target}>"
"${CLANGD_FRAMEWORK_OUT_LOCATION}/${name}"

# Copy the XPC Service PLIST.
Expand All @@ -38,7 +38,7 @@ macro(create_clangd_xpc_framework target name)

# Copy the Clangd binary.
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/clangd"
"$<TARGET_FILE:clangd>"
"${CLANGD_XPC_SERVICE_OUT_LOCATION}/MacOS/clangd"

COMMAND ${CMAKE_COMMAND} -E create_symlink "A"
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clang_target_link_libraries(ClangTidyTests
clangSerialization
clangTooling
clangToolingCore
clangToolingRefactoring
clangTransformer
)
target_link_libraries(ClangTidyTests
PRIVATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include "../clang-tidy/utils/TransformerClangTidyCheck.h"
#include "ClangTidyTest.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Refactoring/RangeSelector.h"
#include "clang/Tooling/Refactoring/Stencil.h"
#include "clang/Tooling/Refactoring/Transformer.h"
#include "clang/Tooling/Transformer/RangeSelector.h"
#include "clang/Tooling/Transformer/Stencil.h"
#include "clang/Tooling/Transformer/Transformer.h"
#include "gtest/gtest.h"

namespace clang {
Expand Down
2 changes: 1 addition & 1 deletion clang/docs/OpenMPSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ implementation.
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| task extension | combined taskloop constructs | :none:`unclaimed` | |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| task extension | master taskloop | :none:`unclaimed` | |
| task extension | master taskloop | :good:`done` | |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| task extension | parallel master taskloop | :none:`unclaimed` | |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
Expand Down
50 changes: 48 additions & 2 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Improvements to Clang's diagnostics
Non-comprehensive list of changes in this release
-------------------------------------------------

* In both C and C++ (C17 ``6.5.6p8``, C++ ``[expr.add]``), pointer arithmetic is
only permitted within arrays. In particular, the behavior of a program is not
defined if it adds a non-zero offset (or in C, any offset) to a null pointer,
or if it forms a null pointer by subtracting an integer from a non-null
pointer, and the LLVM optimizer now uses those guarantees for transformations.
This may lead to unintended behavior in code that performs these operations.
The Undefined Behavior Sanitizer ``-fsanitize=pointer-overflow`` check has
been extended to detect these cases, so that code relying on them can be
detected and fixed.

- For X86 target, -march=skylake-avx512, -march=icelake-client,
-march=icelake-server, -march=cascadelake, -march=cooperlake will default to
not using 512-bit zmm registers in vectorized code unless 512-bit intrinsics
Expand All @@ -70,7 +80,10 @@ Non-comprehensive list of changes in this release
New Compiler Flags
------------------

- ...
- The -fgnuc-version= flag now controls the value of ``__GNUC__`` and related
macros. This flag does not enable or disable any GCC extensions implemented in
Clang. Setting the version to zero causes Clang to leave ``__GNUC__`` and
other GNU-namespaced macros, such as ``__GXX_WEAK__``, undefined.

Deprecated Compiler Flags
-------------------------
Expand Down Expand Up @@ -238,7 +251,40 @@ Static Analyzer
Undefined Behavior Sanitizer (UBSan)
------------------------------------

- ...
- * The ``pointer-overflow`` check was extended added to catch the cases where
a non-zero offset is applied to a null pointer, or the result of
applying the offset is a null pointer.

.. code-block:: c++

#include <cstdint> // for intptr_t

static char *getelementpointer_inbounds(char *base, unsigned long offset) {
// Potentially UB.
return base + offset;
}
char *getelementpointer_unsafe(char *base, unsigned long offset) {
// Always apply offset. UB if base is ``nullptr`` and ``offset`` is not
// zero, or if ``base`` is non-``nullptr`` and ``offset`` is
// ``-reinterpret_cast<intptr_t>(base)``.
return getelementpointer_inbounds(base, offset);
}
char *getelementpointer_safe(char *base, unsigned long offset) {
// Cast pointer to integer, perform usual arithmetic addition,
// and cast to pointer. This is legal.
char *computed =
reinterpret_cast<char *>(reinterpret_cast<intptr_t>(base) + offset);
// If either the pointer becomes non-``nullptr``, or becomes
// ``nullptr``, we must use ``computed`` result.
if (((base == nullptr) && (computed != nullptr)) ||
((base != nullptr) && (computed == nullptr)))
return computed;
// Else we can use ``getelementpointer_inbounds()``.
return getelementpointer_inbounds(base, offset);
}

Core Analysis Improvements
==========================
Expand Down
3 changes: 2 additions & 1 deletion clang/docs/UndefinedBehaviorSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ Available checks are:
``__builtin_object_size``, and consequently may be able to detect more
problems at higher optimization levels.
- ``-fsanitize=pointer-overflow``: Performing pointer arithmetic which
overflows.
overflows, or where either the old or new pointer value is a null pointer
(or in C, when they both are).
- ``-fsanitize=return``: In C++, reaching the end of a
value-returning function without returning a value.
- ``-fsanitize=returns-nonnull-attribute``: Returning null pointer
Expand Down
7 changes: 7 additions & 0 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,13 @@ Other Options
-------------
Clang options that don't fit neatly into other categories.

.. option:: -fgnuc-version=

This flag controls the value of ``__GNUC__`` and related macros. This flag
does not enable or disable any GCC extensions implemented in Clang. Setting
the version to zero causes Clang to leave ``__GNUC__`` and other
GNU-namespaced macros, such as ``__GXX_WEAK__``, undefined.

.. option:: -MV

When emitting a dependency file, use formatting conventions appropriate
Expand Down
7 changes: 6 additions & 1 deletion clang/include/clang-c/Index.h
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,12 @@ enum CXCursorKind {
*/
CXCursor_BuiltinBitCastExpr = 280,

CXCursor_LastStmt = CXCursor_BuiltinBitCastExpr,
/** OpenMP master taskloop directive.
*/
CXCursor_OMPMasterTaskLoopDirective = 281,


CXCursor_LastStmt = CXCursor_OMPMasterTaskLoopDirective,

/**
* Cursor that represents the translation unit itself.
Expand Down
Loading

0 comments on commit 2d5ba8e

Please sign in to comment.