Skip to content

Commit

Permalink
Merge pull request #295 from Xilinx/bump_to_b851c7f1
Browse files Browse the repository at this point in the history
[AutoBump] Merge with b851c7f (Apr 17) (2)
  • Loading branch information
mgehre-amd authored Aug 22, 2024
2 parents b308edb + 91788e3 commit ac378c2
Show file tree
Hide file tree
Showing 373 changed files with 15,258 additions and 8,337 deletions.
10 changes: 0 additions & 10 deletions bolt/include/bolt/Rewrite/RewriteInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,6 @@ class RewriteInstance {
/// rewritten binary.
void patchBuildID();

/// Return file offset corresponding to a given virtual address.
uint64_t getFileOffsetFor(uint64_t Address) {
assert(Address >= NewTextSegmentAddress &&
"address in not in the new text segment");
return Address - NewTextSegmentAddress + NewTextSegmentOffset;
}

/// Return file offset corresponding to a virtual \p Address.
/// Return 0 if the address has no mapping in the file, including being
/// part of .bss section.
Expand All @@ -398,9 +391,6 @@ class RewriteInstance {
/// Return true if the section holds debug information.
static bool isDebugSection(StringRef SectionName);

/// Return true if the section holds linux kernel symbol information.
static bool isKSymtabSection(StringRef SectionName);

/// Adds Debug section to overwrite.
static void addToDebugSectionsToOverwrite(const char *Section) {
DebugSectionsToOverwrite.emplace_back(Section);
Expand Down
7 changes: 0 additions & 7 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5767,10 +5767,3 @@ bool RewriteInstance::isDebugSection(StringRef SectionName) {

return false;
}

bool RewriteInstance::isKSymtabSection(StringRef SectionName) {
if (SectionName.starts_with("__ksymtab"))
return true;

return false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ void UnnecessaryValueParamCheck::check(const MatchFinder::MatchResult &Result) {

TraversalKindScope RAII(*Result.Context, TK_AsIs);

FunctionParmMutationAnalyzer &Analyzer =
MutationAnalyzers.try_emplace(Function, *Function, *Result.Context)
.first->second;
if (Analyzer.isMutated(Param))
FunctionParmMutationAnalyzer *Analyzer =
FunctionParmMutationAnalyzer::getFunctionParmMutationAnalyzer(
*Function, *Result.Context, MutationAnalyzerCache);
if (Analyzer->isMutated(Param))
return;

const bool IsConstQualified =
Expand Down Expand Up @@ -169,7 +169,7 @@ void UnnecessaryValueParamCheck::storeOptions(
}

void UnnecessaryValueParamCheck::onEndOfTranslationUnit() {
MutationAnalyzers.clear();
MutationAnalyzerCache.clear();
}

void UnnecessaryValueParamCheck::handleMoveFix(const ParmVarDecl &Var,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class UnnecessaryValueParamCheck : public ClangTidyCheck {
void handleMoveFix(const ParmVarDecl &Var, const DeclRefExpr &CopyArgument,
const ASTContext &Context);

llvm::DenseMap<const FunctionDecl *, FunctionParmMutationAnalyzer>
MutationAnalyzers;
ExprMutationAnalyzer::Memoized MutationAnalyzerCache;
utils::IncludeInserter Inserter;
const std::vector<StringRef> AllowedTypes;
};
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ Changes in existing checks
<clang-tidy/checks/llvm/header-guard>` check by replacing the local
option `HeaderFileExtensions` by the global option of the same name.

- Improved :doc:`misc-const-correctness
<clang-tidy/checks/misc/const-correctness>` check by avoiding infinite recursion
for recursive forwarding reference.

- Improved :doc:`misc-definitions-in-headers
<clang-tidy/checks/misc/definitions-in-headers>` check by replacing the local
option `HeaderFileExtensions` by the global option of the same name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,18 @@ void concatenate3(Args... args)
(..., (stream << args));
}
} // namespace gh70323

namespace gh60895 {

template <class T> void f1(T &&a);
template <class T> void f2(T &&a);
template <class T> void f1(T &&a) { f2<T>(a); }
template <class T> void f2(T &&a) { f1<T>(a); }
void f() {
int x = 0;
// CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'x' of type 'int' can be declared 'const'
// CHECK-FIXES: int const x = 0;
f1(x);
}

} // namespace gh60895
48 changes: 48 additions & 0 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3466,6 +3466,54 @@ Query for this feature with ``__has_builtin(__builtin_trap)``.
``__builtin_arm_trap`` is lowered to the ``llvm.aarch64.break`` builtin, and then to ``brk #payload``.
``__builtin_allow_runtime_check``
---------------------------------
``__builtin_allow_runtime_check`` return true if the check at the current
program location should be executed. It is expected to be used to implement
``assert`` like checks which can be safely removed by optimizer.
**Syntax**:
.. code-block:: c++
bool __builtin_allow_runtime_check(const char* kind)
**Example of use**:
.. code-block:: c++
if (__builtin_allow_runtime_check("mycheck") && !ExpensiveCheck()) {
abort();
}
**Description**
``__builtin_allow_runtime_check`` is lowered to ` ``llvm.allow.runtime.check``
<https://llvm.org/docs/LangRef.html#llvm-allow-runtime-check-intrinsic>`_
builtin.
The ``__builtin_allow_runtime_check()`` is expected to be used with control
flow conditions such as in ``if`` to guard expensive runtime checks. The
specific rules for selecting permitted checks can differ and are controlled by
the compiler options.
Flags to control checks:
* ``-mllvm -lower-allow-check-percentile-cutoff-hot=N`` where N is PGO hotness
cutoff in range ``[0, 999999]`` to disallow checks in hot code.
* ``-mllvm -lower-allow-check-random-rate=P`` where P is number in range
``[0.0, 1.0]`` representation probability of keeping a check.
* If both flags are specified, ``-lower-allow-check-random-rate`` takes
precedence.
* If none is specified, ``__builtin_allow_runtime_check`` is lowered as
``true``, allowing all checks.
Parameter ``kind`` is a string literal representing a user selected kind for
guarded check. It's unused now. It will enable kind-specific lowering in future.
E.g. a higher hotness cutoff can be used for more expensive kind of check.
Query for this feature with ``__has_builtin(__builtin_allow_runtime_check)``.
``__builtin_nondeterministic_value``
------------------------------------
Expand Down
50 changes: 23 additions & 27 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ AST Dumping Potentially Breaking Changes

Clang Frontend Potentially Breaking Changes
-------------------------------------------
- Removed support for constructing on-stack ``TemplateArgumentList``s; interfaces should instead
- Removed support for constructing on-stack ``TemplateArgumentList``\ s; interfaces should instead
use ``ArrayRef<TemplateArgument>`` to pass template arguments. Transitioning internal uses to
``ArrayRef<TemplateArgument>`` reduces AST memory usage by 0.4% when compiling clang, and is
expected to show similar improvements on other workloads.
Expand Down Expand Up @@ -104,8 +104,7 @@ C++20 Feature Support

- Clang now implements [module.import]p7 fully. Clang now will import module
units transitively for the module units coming from the same module of the
current module units.
Fixes `#84002 <https://github.com/llvm/llvm-project/issues/84002>`_.
current module units. Fixes #GH84002

- Initial support for class template argument deduction (CTAD) for type alias
templates (`P1814R0 <https://wg21.link/p1814r0>`_).
Expand Down Expand Up @@ -135,8 +134,7 @@ C++2c Feature Support
Resolutions to C++ Defect Reports
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Substitute template parameter pack, when it is not explicitly specified
in the template parameters, but is deduced from a previous argument.
(`#78449: <https://github.com/llvm/llvm-project/issues/78449>`_).
in the template parameters, but is deduced from a previous argument. (#GH78449)

- Type qualifications are now ignored when evaluating layout compatibility
of two types.
Expand Down Expand Up @@ -176,8 +174,7 @@ C23 Feature Support

- Clang now generates predefined macros of the form ``__TYPE_FMTB__`` and
``__TYPE_FMTb__`` (e.g., ``__UINT_FAST64_FMTB__``) in C23 mode for use with
macros typically exposed from ``<inttypes.h>``, such as ``PRIb8``.
(`#81896: <https://github.com/llvm/llvm-project/issues/81896>`_).
macros typically exposed from ``<inttypes.h>``, such as ``PRIb8``. (#GH81896)

- Clang now supports `N3018 The constexpr specifier for object definitions`
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3018.htm>`_.
Expand Down Expand Up @@ -215,7 +212,10 @@ New Compiler Flags

- ``-Wmissing-designated-field-initializers``, grouped under ``-Wmissing-field-initializers``.
This diagnostic can be disabled to make ``-Wmissing-field-initializers`` behave
like it did before Clang 18.x. Fixes (`#56628 <https://github.com/llvm/llvm-project/issues/68933>`_)
like it did before Clang 18.x. Fixes #GH56628

- ``-fexperimental-modules-reduced-bmi`` enables the Reduced BMI for C++20 named modules.
See the document of standard C++ modules for details.

Deprecated Compiler Flags
-------------------------
Expand Down Expand Up @@ -254,8 +254,7 @@ Removed Compiler Flags

- The ``-freroll-loops`` flag has been removed. It had no effect since Clang 13.
- ``-m[no-]unaligned-access`` is removed for RISC-V and LoongArch.
``-m[no-]strict-align``, also supported by GCC, should be used instead.
(`#85350 <https://github.com/llvm/llvm-project/pull/85350>`_.)
``-m[no-]strict-align``, also supported by GCC, should be used instead. (#GH85350)

Attribute Changes in Clang
--------------------------
Expand Down Expand Up @@ -325,8 +324,7 @@ Improvements to Clang's diagnostics
Fixes #GH82512.

- Clang now provides improved warnings for the ``cleanup`` attribute to detect misuse scenarios,
such as attempting to call ``free`` on an unallocated object. Fixes
`#79443 <https://github.com/llvm/llvm-project/issues/79443>`_.
such as attempting to call ``free`` on an unallocated object. Fixes #GH79443.

- Clang no longer warns when the ``bitand`` operator is used with boolean
operands, distinguishing it from potential typographical errors or unintended
Expand Down Expand Up @@ -372,11 +370,10 @@ Improvements to Clang's time-trace
Bug Fixes in This Version
-------------------------
- Clang's ``-Wundefined-func-template`` no longer warns on pure virtual
functions.
(`#74016 <https://github.com/llvm/llvm-project/issues/74016>`_)
functions. (#GH74016)

- Fixed missing warnings when comparing mismatched enumeration constants
in C (`#29217 <https://github.com/llvm/llvm-project/issues/29217>`).
in C (#GH29217)

- Clang now accepts elaborated-type-specifiers that explicitly specialize
a member class template for an implicit instantiation of a class template.
Expand Down Expand Up @@ -415,14 +412,16 @@ Bug Fixes in This Version
type only rather than to the complex type (e.g. ``_Complex float / int`` is now evaluated
as ``_Complex float / float`` rather than ``_Complex float / _Complex float``), as mandated
by the C standard. This significantly improves codegen of `*` and `/` especially.
Fixes (`#31205 <https://github.com/llvm/llvm-project/issues/31205>`_).
Fixes #GH31205.

- Fixes an assertion failure on invalid code when trying to define member
functions in lambdas.

- Fixed a regression in CTAD that a friend declaration that befriends itself may cause
incorrect constraint substitution. (#GH86769).

- Fixed an assertion failure on invalid InitListExpr in C89 mode (#GH88008).

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -464,8 +463,7 @@ Bug Fixes to C++ Support
- Fix a crash when trying to call a varargs function that also has an explicit object parameter. (#GH80971)
- Fixed a bug where abbreviated function templates would append their invented template parameters to
an empty template parameter lists.
- Fix parsing of abominable function types inside type traits.
Fixes (`#77585 <https://github.com/llvm/llvm-project/issues/77585>`_)
- Fix parsing of abominable function types inside type traits. Fixes #GH77585
- Clang now classifies aggregate initialization in C++17 and newer as constant
or non-constant more accurately. Previously, only a subset of the initializer
elements were considered, misclassifying some initializers as constant. Partially fixes
Expand Down Expand Up @@ -506,9 +504,7 @@ Bug Fixes to C++ Support
- Fix a bug where overload resolution falsely reported an ambiguity when it was comparing
a member-function against a non member function or a member-function with an
explicit object parameter against a member function with no explicit object parameter
when one of the function had more specialized templates.
Fixes (`#82509 <https://github.com/llvm/llvm-project/issues/82509>`_)
and (`#74494 <https://github.com/llvm/llvm-project/issues/74494>`_)
when one of the function had more specialized templates. Fixes #GH82509 and #GH74494
- Clang now supports direct lambda calls inside of a type alias template declarations.
This addresses (#GH70601), (#GH76674), (#GH79555), (#GH81145) and (#GH82104).
- Allow access to a public template alias declaration that refers to friend's
Expand All @@ -530,15 +526,15 @@ Bug Fixes to C++ Support
- Fixed a bug that prevented member function templates of class templates declared with a deduced return type
from being explicitly specialized for a given implicit instantiation of the class template.

- Fix crash when inheriting from a cv-qualified type. Fixes:
(`#35603 <https://github.com/llvm/llvm-project/issues/35603>`_)
- Fix crash when inheriting from a cv-qualified type. Fixes #GH35603
- Fix a crash when the using enum declaration uses an anonymous enumeration. Fixes (#GH86790).
- Handled an edge case in ``getFullyPackExpandedSize`` so that we now avoid a false-positive diagnostic. (#GH84220)
- Clang now correctly tracks type dependence of by-value captures in lambdas with an explicit
object parameter.
Fixes (#GH70604), (#GH79754), (#GH84163), (#GH84425), (#GH86054), (#GH86398), and (#GH86399).
- Fix a crash when deducing ``auto`` from an invalid dereference (#GH88329).
- Fix a crash in requires expression with templated base class member function. Fixes (#GH84020).
- Placement new initializes typedef array with correct size (#GH41441)

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -552,8 +548,7 @@ Miscellaneous Clang Crashes Fixed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Do not attempt to dump the layout of dependent types or invalid declarations
when ``-fdump-record-layouts-complete`` is passed.
Fixes (`#83684 <https://github.com/llvm/llvm-project/issues/83684>`_).
when ``-fdump-record-layouts-complete`` is passed. Fixes #GH83684.

OpenACC Specific Changes
------------------------
Expand Down Expand Up @@ -603,8 +598,7 @@ Windows Support
would only be included if AVX was enabled at compile time. This was done to work
around include times from MSVC STL including ``intrin.h`` under clang-cl.
Clang-cl now provides ``intrin0.h`` for MSVC STL and therefore all intrinsic
features without requiring enablement at compile time.
Fixes: (`#53520 <https://github.com/llvm/llvm-project/issues/53520>`_)
features without requiring enablement at compile time. Fixes #GH53520

- Improved compile times with MSVC STL. MSVC provides ``intrin0.h`` which is a
header that only includes intrinsics that are used by MSVC STL to avoid the
Expand Down Expand Up @@ -685,6 +679,8 @@ Static Analyzer
but not under any case blocks if ``unroll-loops=true`` analyzer config is
set. (#GH68819)
- Support C++23 static operator calls. (#GH84972)
- Fixed a crash in ``security.cert.env.InvalidPtr`` checker when accidentally
matched user-defined ``strerror`` and similar library functions. (GH#88181)

New features
^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit ac378c2

Please sign in to comment.