mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 13:36:08 +00:00
[libc++][CI] Fixes error messages.
Fixes 2 error messages from the module test clang-tidy plugin. - an issue where an empty filename can't be used in an AST matcher - an issue where no filename is valid when testing the std module cppm This reduces the output of the test, making it easier to find the real error when the test fails. Reviewed By: philnik, #libc Differential Revision: https://reviews.llvm.org/D157741
This commit is contained in:
parent
8f01029b17
commit
2c629eb508
@ -38,15 +38,18 @@ header_exportable_declarations::header_exportable_declarations(
|
||||
filename_(Options.get("Filename", "")),
|
||||
file_type_(Options.get("FileType", header_exportable_declarations::FileType::Unknown)),
|
||||
extra_header_(Options.get("ExtraHeader", "")) {
|
||||
if (filename_.empty())
|
||||
llvm::errs() << "No filename is provided.\n";
|
||||
|
||||
switch (file_type_) {
|
||||
case header_exportable_declarations::FileType::Header:
|
||||
/* DO NOTHING */
|
||||
if (filename_.empty())
|
||||
llvm::errs() << "No filename is provided.\n";
|
||||
if (extra_header_.empty())
|
||||
extra_header_ = "$^"; // Use a never matching regex to silence an error message.
|
||||
break;
|
||||
case header_exportable_declarations::FileType::Module:
|
||||
case header_exportable_declarations::FileType::ModulePartition:
|
||||
if (filename_.empty())
|
||||
llvm::errs() << "No filename is provided.\n";
|
||||
[[fallthrough]];
|
||||
case header_exportable_declarations::FileType::Module:
|
||||
if (!extra_header_.empty())
|
||||
llvm::errs() << "Extra headers are not allowed for modules.\n";
|
||||
if (Options.get("SkipDeclarations"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user