Skip to content

Commit

Permalink
Merge pull request #340 from Xilinx/bump_to_41fecca9
Browse files Browse the repository at this point in the history
[AutoBump] Merge with 41fecca (Jun 14) (76)
  • Loading branch information
mgehre-amd authored Sep 13, 2024
2 parents b99af9c + 7a86532 commit 5e5958a
Show file tree
Hide file tree
Showing 1,070 changed files with 26,686 additions and 14,673 deletions.
3 changes: 2 additions & 1 deletion .ci/generate-buildkite-pipeline-premerge
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function compute-projects-to-test() {
fi
;;
clang)
for p in clang-tools-extra compiler-rt lldb cross-project-tests; do
# lldb is temporarily removed to alleviate Linux pre-commit CI waiting times
for p in clang-tools-extra compiler-rt cross-project-tests; do
echo $p
done
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
script: |
const failure_regex = /Process completed with exit code 1./
const preemption_regex = /The runner has received a shutdown signal/
const wf_run = context.payload.workflow_run
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
Expand Down Expand Up @@ -80,30 +80,30 @@ jobs:
}
check_run_ids.push(check_run.id);
}
has_preempted_job = false;
for (check_run_id of check_run_ids) {
console.log('Listing annotations for check run: ' + check_run_id);
annotations = await github.rest.checks.listAnnotations({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: check_run_id
})
for (annotation of annotations.data) {
if (annotation.annotation_level != 'failure') {
continue;
}
const preemption_match = annotation.message.match(preemption_regex);
if (preemption_match != null) {
console.log('Found preemption message: ' + annotation.message);
has_preempted_job = true;
}
const failure_match = annotation.message.match(failure_regex);
if (failure_match != null) {
// We only want to restart the workflow if all of the failures were due to preemption.
Expand All @@ -115,20 +115,18 @@ jobs:
return;
}
}
}
}
if (!has_preempted_job) {
core.notice('No preempted jobs found. Not restarting workflow.');
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
return;
}
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id
})
await create_check_run('success', 'Restarted workflow run due to preempted job')
5 changes: 3 additions & 2 deletions bolt/lib/Rewrite/LinuxKernelRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,8 +1479,9 @@ Error LinuxKernelRewriter::tryReadAltInstructions(uint32_t AltInstFeatureSize,
}
}

BC.outs() << "BOLT-INFO: parsed " << EntryID
<< " alternative instruction entries\n";
if (!ParseOnly)
BC.outs() << "BOLT-INFO: parsed " << EntryID
<< " alternative instruction entries\n";

return Error::success();
}
Expand Down
40 changes: 34 additions & 6 deletions clang-tools-extra/clang-doc/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,38 @@ target_link_libraries(clang-doc
clangDoc
)

install(FILES ../assets/clang-doc-default-stylesheet.css
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-doc)

install(FILES ../assets/index.js
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-doc)
set(assets
index.js
clang-doc-default-stylesheet.css
)

set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
set(resource_dir "${CMAKE_BINARY_DIR}/share/clang")
set(out_files)

function(copy_files_to_dst src_dir dst_dir file)
set(src "${src_dir}/${file}")
set(dst "${dst_dir}/${file}")
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
COMMENT "Copying ${file} to ${dst_dir}"
)
list(APPEND out_files ${dst})
set(out_files ${out_files} PARENT_SCOPE)
endfunction(copy_files_to_dst)

foreach(f ${assets})
install(FILES ${asset_dir}/${f}
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-doc)
copy_files_to_dst(${asset_dir} ${resource_dir} ${f})
endforeach(f)

add_custom_target(copy-clang-doc-assets
DEPENDS ${out_files}
COMMENT "Copying Clang-Doc Assets"
)
set_target_properties(copy-clang-doc-assets PROPERTIES FOLDER "Clang-Doc/Assets")
add_dependencies(clang-doc copy-clang-doc-assets)
10 changes: 5 additions & 5 deletions clang-tools-extra/clangd/TidyProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ TidyProvider addTidyChecks(llvm::StringRef Checks,
}

TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
constexpr llvm::StringLiteral Seperator(",");
constexpr llvm::StringLiteral Separator(",");
static const std::string BadChecks = llvm::join_items(
Seperator,
// We want this list to start with a seperator to
Separator,
// We want this list to start with a separator to
// simplify appending in the lambda. So including an
// empty string here will force that.
"",
Expand Down Expand Up @@ -227,7 +227,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
for (const std::string &Str : ExtraBadChecks) {
if (Str.empty())
continue;
Size += Seperator.size();
Size += Separator.size();
if (LLVM_LIKELY(Str.front() != '-'))
++Size;
Size += Str.size();
Expand All @@ -238,7 +238,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
for (const std::string &Str : ExtraBadChecks) {
if (Str.empty())
continue;
DisableGlob += Seperator;
DisableGlob += Separator;
if (LLVM_LIKELY(Str.front() != '-'))
DisableGlob.push_back('-');
DisableGlob += Str;
Expand Down
11 changes: 9 additions & 2 deletions clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "clang-include-cleaner/IncludeSpeller.h"
#include "clang-include-cleaner/Types.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Registry.h"
#include <memory>
Expand All @@ -30,8 +31,14 @@ class DefaultIncludeSpeller : public IncludeSpeller {
return Input.H.verbatim().str();
case Header::Physical:
bool IsAngled = false;
std::string WorkingDir;
if (auto WD = Input.HS.getFileMgr()
.getVirtualFileSystem()
.getCurrentWorkingDirectory())
WorkingDir = *WD;
std::string FinalSpelling = Input.HS.suggestPathToFileForDiagnostics(
Input.H.physical(), Input.Main->tryGetRealPathName(), &IsAngled);
Input.H.resolvedPath(), WorkingDir, Input.Main->tryGetRealPathName(),
&IsAngled);
return IsAngled ? "<" + FinalSpelling + ">" : "\"" + FinalSpelling + "\"";
}
llvm_unreachable("Unknown clang::include_cleaner::Header::Kind enum");
Expand Down Expand Up @@ -60,4 +67,4 @@ std::string spellHeader(const IncludeSpeller::Input &Input) {
return Spelling;
}

} // namespace clang::include_cleaner
} // namespace clang::include_cleaner
18 changes: 18 additions & 0 deletions clang-tools-extra/include-cleaner/unittests/IncludeSpellerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@ TEST(IncludeSpeller, CanOverrideSystemHeaders) {
HS, MainFile}));
}

TEST(IncludeSpeller, RelativeIncludeSearchPath) {
TestInputs Inputs;

Inputs.WorkingDir = "/root/inner";
Inputs.ExtraArgs.push_back("-I..");
Inputs.ExtraFiles["/root/foo.h"] = "";
TestAST AST{Inputs};

auto &FM = AST.fileManager();
auto &HS = AST.preprocessor().getHeaderSearchInfo();
const auto *MainFile = AST.sourceManager().getFileEntryForID(
AST.sourceManager().getMainFileID());

EXPECT_EQ("\"foo.h\"",
spellHeader(
{Header{*FM.getOptionalFileRef("/root/foo.h")}, HS, MainFile}));
}

IncludeSpellingStrategy::Add<DummyIncludeSpeller>
Speller("dummy", "Dummy Include Speller");

Expand Down
8 changes: 4 additions & 4 deletions clang/bindings/python/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def name(self):

@classmethod
def from_id(cls, id):
if id >= len(cls._kinds) or cls._kinds[id] is None:
if id < 0 or id >= len(cls._kinds) or cls._kinds[id] is None:
raise ValueError("Unknown template argument kind %d" % id)
return cls._kinds[id]

Expand Down Expand Up @@ -1336,7 +1336,7 @@ def __repr__(self):
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(271)

# OpenMP teams distribute simd directive.
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(272)
CursorKind.OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE = CursorKind(272)

# OpenMP teams distribute parallel for simd directive.
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(273)
Expand Down Expand Up @@ -2215,7 +2215,7 @@ def name(self):

@staticmethod
def from_id(id):
if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
if id < 0 or id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
raise ValueError("Unknown storage class %d" % id)
return StorageClass._kinds[id]

Expand Down Expand Up @@ -2395,7 +2395,7 @@ def __repr__(self):
TypeKind.OCLRESERVEID = TypeKind(160)

TypeKind.OBJCOBJECT = TypeKind(161)
TypeKind.OBJCCLASS = TypeKind(162)
TypeKind.OBJCTYPEPARAM = TypeKind(162)
TypeKind.ATTRIBUTED = TypeKind(163)

TypeKind.OCLINTELSUBGROUPAVCMCEPAYLOAD = TypeKind(164)
Expand Down
47 changes: 47 additions & 0 deletions clang/bindings/python/tests/cindex/test_enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import unittest

from clang.cindex import (
CursorKind,
TemplateArgumentKind,
ExceptionSpecificationKind,
AvailabilityKind,
AccessSpecifier,
TypeKind,
RefQualifierKind,
LinkageKind,
TLSKind,
StorageClass,
)


class TestCursorKind(unittest.TestCase):
enums = [
CursorKind,
TemplateArgumentKind,
ExceptionSpecificationKind,
AvailabilityKind,
AccessSpecifier,
TypeKind,
RefQualifierKind,
LinkageKind,
TLSKind,
StorageClass,
]

def test_from_id(self):
"""Check that kinds can be constructed from valid IDs"""
for enum in self.enums:
self.assertEqual(enum.from_id(2), enum._kinds[2])
with self.assertRaises(ValueError):
enum.from_id(len(enum._kinds))
with self.assertRaises(ValueError):
enum.from_id(-1)

def test_unique_kinds(self):
"""Check that no kind name has been used multiple times"""
for enum in self.enums:
for id in range(len(enum._kinds)):
try:
enum.from_id(id).name
except ValueError:
pass
6 changes: 3 additions & 3 deletions clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ if(FUCHSIA_SDK)
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
endif()

foreach(target armv6m-unknown-eabi)
foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m-unknown-eabi)
list(APPEND BUILTIN_TARGETS "${target}")
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
foreach(lang C;CXX;ASM)
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand All @@ -321,7 +321,7 @@ foreach(target armv6m-unknown-eabi)
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
foreach(lang C;CXX;ASM)
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand Down
15 changes: 15 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ Clang Frontend Potentially Breaking Changes
- The ``hasTypeLoc`` AST matcher will no longer match a ``classTemplateSpecializationDecl``;
existing uses should switch to ``templateArgumentLoc`` or ``hasAnyTemplateArgumentLoc`` instead.

Clang Python Bindings Potentially Breaking Changes
--------------------------------------------------
- Renamed ``CursorKind`` variant 272 from ``OMP_TEAMS_DISTRIBUTE_DIRECTIVE``
to ``OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE``. The previous name was incorrect, it was a duplicate
of variant 271.
- Renamed ``TypeKind`` variant 162 from ``OBJCCLASS`` to ``OBJCTYPEPARAM``.
The previous name was incorrect, it was a duplicate of variant 28.

What's New in Clang |release|?
==============================
Some of the major new features and improvements to Clang are listed
Expand Down Expand Up @@ -343,6 +351,9 @@ Non-comprehensive list of changes in this release
- Added ``__is_bitwise_cloneable`` which is used to check whether a type
can be safely copied by memcpy/memmove.

- ``#pragma GCC diagnostic warning "-Wfoo"`` can now downgrade ``-Werror=foo``
errors and certain default-to-error ``-W`` diagnostics to warnings.

New Compiler Flags
------------------
- ``-fsanitize=implicit-bitfield-conversion`` checks implicit truncation and
Expand Down Expand Up @@ -921,6 +932,10 @@ Android Support
Windows Support
^^^^^^^^^^^^^^^

- The clang-cl ``/Ot`` compiler option ("optimize for speed", also implied by
``/O2``) now maps to clang's ``-O3`` optimizataztion level instead of ``-O2``.
Users who prefer the old behavior can use ``clang-cl /Ot /clang:-O2 ...``.

- Clang-cl now supports function targets with intrinsic headers. This allows
for runtime feature detection of intrinsics. Previously under clang-cl
``immintrin.h`` and similar intrinsic headers would only include the intrinsics
Expand Down
Loading

0 comments on commit 5e5958a

Please sign in to comment.