Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
378630b
[SPIR-V] Support cl_ext_float_atomics and fix errors in definition of…
VyacheslavLevytskyy Jun 26, 2024
8ab6677
[RISCV] Add Zfh to typeIsScalarFPArith and simplify code. NFC
topperc Jun 26, 2024
868fae1
[RISCV][GISel] Support G_FPEXT/FPTRUNC with ZFh.
topperc Jun 26, 2024
141bea8
[DirectX] Add stub PSV0 section (#96712)
damyanp Jun 26, 2024
0f24a46
[llvm-config] Make llvm-config --system-libs obey LLVM_USE_STATIC_ZST…
khuey Jun 26, 2024
3f78d89
[TypeProf][InstrFDO]Omit vtable symbols in indexed profiles by defaul…
mingmingl-llvm Jun 26, 2024
d29fdfb
[LTO] Avoid assert fail on failed pass plugin load (#96691)
jdenny-ornl Jun 26, 2024
d058b51
Revert "[AArch64] Lower extending sitofp using tbl (#92528)"
momchil-velikov Jun 26, 2024
22b36bf
[Memprof] Fix a warning
kazutakahirata Jun 26, 2024
6b1c51b
[OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (#…
TIFitis Jun 26, 2024
a89a541
Fix test introduced by d29fdfbc4e3b
jdenny-ornl Jun 26, 2024
133492f
[libc] add proxy header for struct_sigaction (#96224)
SchrodingerZhu Jun 26, 2024
57d3d07
[libc] added newhdrgen class implementation (#96710)
RoseZhang03 Jun 26, 2024
a54704d
[WebAssembly] Split and tidy up target features test (#96735)
aheejin Jun 26, 2024
eeb9316
[runtimes][NFC] Improve error message when running Lit incorrectly
ldionne Jun 26, 2024
2582d11
[ADT] Always use 32-bit size type for SmallVector with 16-bit element…
jayfoad Jun 26, 2024
2f57df5
[CodeGen] Fix a warning
kazutakahirata Jun 26, 2024
49e5cd2
[LV][NFC] Marked functions as const. Added LLVM_DEBUG. (#96681)
nikolaypanchenko Jun 26, 2024
02b57de
[libc] NVPTX Profiling (#92009)
jameshu15869 Jun 26, 2024
0c56fd0
[SimplifyCFG] Forward indirect switch condition value if it can help …
dianqk Jun 26, 2024
1abe22c
Revert "[ADT] Always use 32-bit size type for SmallVector with 16-bit…
chelcassanova Jun 26, 2024
3a462d8
[mlgo] drop the prefix `_` in `_model_selector`
mtrofin Jun 26, 2024
c7adfb5
Revert "[SimplifyCFG] Forward indirect switch condition value if it c…
dianqk Jun 26, 2024
5dcf3d5
[MS ABI]: Support preserve_none in MS ABI (#96487)
antangelo Jun 26, 2024
f23a5f0
[libc] Remove atomic alignment diagnostics globally (#96803)
jhuber6 Jun 26, 2024
5a052ef
Reapply "[SimplifyCFG] Forward indirect switch condition value if it …
dianqk Jun 26, 2024
8f2d74a
[clang-tidy] add default value for misc-use-internal-linkage [NFC] (#…
HerrCai0907 Jun 26, 2024
4558e45
[clang-tidy] add option to avoid "no checks enabled" error (#96122)
HerrCai0907 Jun 26, 2024
1fa9f50
[libc] added newhdrgen python script and class file (#96671)
aaryanshukla Jun 26, 2024
dae061f
[CodeGen] Use range-based for loops (NFC) (#96777)
kazutakahirata Jun 26, 2024
ca4e5a8
[Memprof] Fixes memory leak in MemInfoBlock histogram. (#96834)
mattweingarten Jun 27, 2024
326ba38
[ValueTracking][RISCV] Use ConstantRange::getUnsignedMax instead of g…
topperc Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ option is recognized.
)"),
cl::init(false), cl::cat(ClangTidyCategory));

static cl::opt<bool> AllowNoChecks("allow-no-checks", desc(R"(
Allow empty enabled checks. This suppresses
the "no checks enabled" error when disabling
all of the checks.
)"),
cl::init(false),
cl::cat(ClangTidyCategory));

namespace clang::tidy {

static void printStats(const ClangTidyStats &Stats) {
Expand Down Expand Up @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) {
}

if (ListChecks) {
if (EnabledChecks.empty()) {
if (EnabledChecks.empty() && !AllowNoChecks) {
llvm::errs() << "No checks enabled.\n";
return 1;
}
Expand Down Expand Up @@ -652,6 +660,10 @@ int clangTidyMain(int argc, const char **argv) {
}

if (EnabledChecks.empty()) {
if (AllowNoChecks) {
llvm::outs() << "No checks enabled.\n";
return 0;
}
llvm::errs() << "Error: no checks enabled.\n";
llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true);
return 1;
Expand Down
7 changes: 7 additions & 0 deletions clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ def main():
default=[],
help="Load the specified plugin in clang-tidy.",
)
parser.add_argument(
"-allow-no-checks",
action="store_true",
help="Allow empty enabled checks.",
)

clang_tidy_args = []
argv = sys.argv[1:]
Expand Down Expand Up @@ -327,6 +332,8 @@ def main():
common_clang_tidy_args.append("-p=%s" % args.build_path)
if args.use_color:
common_clang_tidy_args.append("--use-color")
if args.allow_no_checks:
common_clang_tidy_args.append("--allow-no-checks")
for arg in args.extra_arg:
common_clang_tidy_args.append("-extra-arg=%s" % arg)
for arg in args.extra_arg_before:
Expand Down
10 changes: 10 additions & 0 deletions clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def get_tidy_invocation(
plugins,
warnings_as_errors,
exclude_header_filter,
allow_no_checks,
):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
Expand Down Expand Up @@ -147,6 +148,8 @@ def get_tidy_invocation(
start.append("-load=" + plugin)
if warnings_as_errors:
start.append("--warnings-as-errors=" + warnings_as_errors)
if allow_no_checks:
start.append("--allow-no-checks")
start.append(f)
return start

Expand Down Expand Up @@ -232,6 +235,7 @@ def run_tidy(args, clang_tidy_binary, tmpdir, build_path, queue, lock, failed_fi
args.plugins,
args.warnings_as_errors,
args.exclude_header_filter,
args.allow_no_checks,
)

proc = subprocess.Popen(
Expand Down Expand Up @@ -405,6 +409,11 @@ def main():
default=None,
help="Upgrades warnings to errors. Same format as '-checks'.",
)
parser.add_argument(
"-allow-no-checks",
action="store_true",
help="Allow empty enabled checks.",
)
args = parser.parse_args()

db_path = "compile_commands.json"
Expand Down Expand Up @@ -466,6 +475,7 @@ def main():
args.plugins,
args.warnings_as_errors,
args.exclude_header_filter,
args.allow_no_checks,
)
invocation.append("-list-checks")
invocation.append("-")
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ Improvements to clang-tidy
- Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex`
to exclude headers from analysis via a RegEx.

- Added argument `--allow-no-checks` to suppress "no checks enabled" error
when disabling all of the checks by `--checks='-*'`.

New checks
^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Options

.. option:: FixMode

Selects what kind of a fix the check should provide.
Selects what kind of a fix the check should provide. The default is `UseStatic`.

``None``
Don't fix automatically.
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/docs/clang-tidy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ An overview of all the command-line options:
This option's value is appended to the value of
the 'WarningsAsErrors' option in .clang-tidy
file, if any.
--allow-no-checks - Allow empty enabled checks. This suppresses
the "no checks enabled" error when disabling
all of the checks.

-p <build-path> is used to read a compile command database.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// RUN: not clang-tidy %s -checks='-*'
// RUN: clang-tidy %s -checks='-*' --allow-no-checks | FileCheck --match-full-lines %s

// CHECK: No checks enabled.
2 changes: 1 addition & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m-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} -mthumb" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb -Wno-atomic-alignment" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand Down
70 changes: 51 additions & 19 deletions clang/lib/AST/MicrosoftMangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ class MicrosoftCXXNameMangler {
void mangleDecayedArrayType(const ArrayType *T);
void mangleArrayType(const ArrayType *T);
void mangleFunctionClass(const FunctionDecl *FD);
void mangleCallingConvention(CallingConv CC);
void mangleCallingConvention(const FunctionType *T);
void mangleCallingConvention(CallingConv CC, SourceRange Range);
void mangleCallingConvention(const FunctionType *T, SourceRange Range);
void mangleIntegerLiteral(const llvm::APSInt &Number,
const NonTypeTemplateParmDecl *PD = nullptr,
QualType TemplateArgType = QualType());
Expand Down Expand Up @@ -888,7 +888,8 @@ void MicrosoftCXXNameMangler::mangleVirtualMemPtrThunk(
Out << "$B";
mangleNumber(OffsetInVFTable);
Out << 'A';
mangleCallingConvention(MD->getType()->castAs<FunctionProtoType>());
mangleCallingConvention(MD->getType()->castAs<FunctionProtoType>(),
MD->getSourceRange());
}

void MicrosoftCXXNameMangler::mangleName(GlobalDecl GD) {
Expand Down Expand Up @@ -2768,7 +2769,7 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T,
mangleQualifiers(Quals, /*IsMember=*/false);
}

mangleCallingConvention(CC);
mangleCallingConvention(CC, Range);

// <return-type> ::= <type>
// ::= @ # structors (they have no declared return type)
Expand Down Expand Up @@ -2949,7 +2950,8 @@ void MicrosoftCXXNameMangler::mangleFunctionClass(const FunctionDecl *FD) {
Out << 'Y';
}
}
void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC,
SourceRange Range) {
// <calling-convention> ::= A # __cdecl
// ::= B # __export __cdecl
// ::= C # __pascal
Expand All @@ -2962,7 +2964,10 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
// ::= J # __export __fastcall
// ::= Q # __vectorcall
// ::= S # __attribute__((__swiftcall__)) // Clang-only
// ::= T # __attribute__((__swiftasynccall__))
// ::= W # __attribute__((__swiftasynccall__))
// ::= U # __attribute__((__preserve_most__))
// ::= V # __attribute__((__preserve_none__)) //
// Clang-only
// // Clang-only
// ::= w # __regcall
// ::= x # __regcall4
Expand All @@ -2974,28 +2979,55 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {

switch (CC) {
default:
llvm_unreachable("Unsupported CC for mangling");
break;
case CC_Win64:
case CC_X86_64SysV:
case CC_C: Out << 'A'; break;
case CC_X86Pascal: Out << 'C'; break;
case CC_X86ThisCall: Out << 'E'; break;
case CC_X86StdCall: Out << 'G'; break;
case CC_X86FastCall: Out << 'I'; break;
case CC_X86VectorCall: Out << 'Q'; break;
case CC_Swift: Out << 'S'; break;
case CC_SwiftAsync: Out << 'W'; break;
case CC_PreserveMost: Out << 'U'; break;
case CC_C:
Out << 'A';
return;
case CC_X86Pascal:
Out << 'C';
return;
case CC_X86ThisCall:
Out << 'E';
return;
case CC_X86StdCall:
Out << 'G';
return;
case CC_X86FastCall:
Out << 'I';
return;
case CC_X86VectorCall:
Out << 'Q';
return;
case CC_Swift:
Out << 'S';
return;
case CC_SwiftAsync:
Out << 'W';
return;
case CC_PreserveMost:
Out << 'U';
return;
case CC_PreserveNone:
Out << 'V';
return;
case CC_X86RegCall:
if (getASTContext().getLangOpts().RegCall4)
Out << "x";
else
Out << "w";
break;
return;
}

DiagnosticsEngine &Diags = Context.getDiags();
unsigned DiagID = Diags.getCustomDiagID(
DiagnosticsEngine::Error, "cannot mangle this calling convention yet");
Diags.Report(Range.getBegin(), DiagID) << Range;
}
void MicrosoftCXXNameMangler::mangleCallingConvention(const FunctionType *T) {
mangleCallingConvention(T->getCallConv());
void MicrosoftCXXNameMangler::mangleCallingConvention(const FunctionType *T,
SourceRange Range) {
mangleCallingConvention(T->getCallConv(), Range);
}

void MicrosoftCXXNameMangler::mangleThrowSpecification(
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ WindowsARM64TargetInfo::checkCallingConvention(CallingConv CC) const {
case CC_OpenCLKernel:
case CC_PreserveMost:
case CC_PreserveAll:
case CC_PreserveNone:
case CC_Swift:
case CC_SwiftAsync:
case CC_Win64:
Expand Down
Loading