https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/111375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -173,6 +173,7 @@ class Action : public clang::ASTFrontendAction {
if (!HTMLReportPath.empty())
writeHTML();
+// Source File's path relative to compilation database.
llvm::StringRef Path =
kadircet wrote:
can we keep reporting with abs-pa
https://github.com/kadircet commented:
thanks a lot for the revision!
One concern is, we can't really use `getAllCompileCommands()` reliably either,
not all compilation databases implement that, and even if they do this is gonna
be an overkill. For example for chromium we'll iterate over tens
https://github.com/kadircet approved this pull request.
thanks for bearing with me!
https://github.com/llvm/llvm-project/pull/111723
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kadircet wrote:
Sorry for not responding here for a while.
> These change mirror interface to getFileOrSTDIN() which has a IsText
> parameter. This does touch a number of places but I feel the changes are in
> line with the rest of the file I/O functions in llvm.
I think there's a huge differ
@@ -243,14 +244,16 @@ class AnnotatingParser {
// operator that was misinterpreted because we are parsing template
// parameters.
// FIXME: This is getting out of hand, write a decent parser.
- if (InExpr && !Line.startsWith(tok::kw_template) &&
+ if
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/110091
From 02e1677ed40ef23792943d9b2cb895ba80312ee9 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Thu, 26 Sep 2024 10:55:49 +0200
Subject: [PATCH] [clangd] Improve filtering logic for undesired proto symbols
@@ -75,18 +76,61 @@ bool isPrivateProtoDecl(const NamedDecl &ND) {
if (ND.getIdentifier() == nullptr)
return false;
auto Name = ND.getIdentifier()->getName();
- if (!Name.contains('_'))
-return false;
- // Nested proto entities (e.g. Message::Nested) have top-leve
@@ -75,18 +76,61 @@ bool isPrivateProtoDecl(const NamedDecl &ND) {
if (ND.getIdentifier() == nullptr)
return false;
auto Name = ND.getIdentifier()->getName();
- if (!Name.contains('_'))
-return false;
- // Nested proto entities (e.g. Message::Nested) have top-leve
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/110083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet commented:
thanks!
https://github.com/llvm/llvm-project/pull/110083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2122,7 +2125,10 @@ clang::CodeCompleteOptions
CodeCompleteOptions::getClangCompleteOpts() const {
// When an is used, Sema is responsible for completing the main file,
// the index can provide results from the preamble.
// Tell Sema not to deserialize the preamble to
@@ -52,6 +52,9 @@ struct CodeCompleteOptions {
/// For example, private members are usually inaccessible.
bool IncludeIneligibleResults = false;
+ /// Whether the experimental modules support are enabled.
+ bool ExperimentalModulesSupport = false;
kadirc
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/110272
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -52,6 +52,11 @@ struct CodeCompleteOptions {
/// For example, private members are usually inaccessible.
bool IncludeIneligibleResults = false;
+ /// Force sema to load decls from preamble even if an index is provided.
+ /// This is helpful for cases the index can't pr
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/110083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet approved this pull request.
thanks!
https://github.com/llvm/llvm-project/pull/110083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/108671
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules {
/// different versions and different source files.
class ModulesBuilder {
kadircet wrote:
can we just introduce a new helper class
```cpp
class ModulesBuilder {
...
private:
class ModuleFileCache;
std::unique_
@@ -85,19 +85,20 @@ class PrerequisiteModules {
/// different versions and different source files.
class ModulesBuilder {
public:
- ModulesBuilder(const GlobalCompilationDatabase &CDB) : CDB(CDB) {}
+ ModulesBuilder() = default;
+ virtual ~ModulesBuilder() = default;
Mo
@@ -338,17 +460,129 @@ ModulesBuilder::buildPrerequisiteModulesFor(PathRef File,
return std::move(RequiredModules);
}
-bool StandalonePrerequisiteModules::canReuse(
+ReusableModulesBuilder::ModuleBuildingSharedOwner
+ReusableModulesBuilder::getOrCreateModuleBuildingOwner(Str
https://github.com/kadircet requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106683
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kadircet wrote:
btw, LMK if you don't have commit access and I should merge this for you
https://github.com/llvm/llvm-project/pull/111375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/112517
From 01a538fbbd93a7f26e1309c9c95d5be0c8500402 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 14 Oct 2024 11:20:55 +0200
Subject: [PATCH 1/2] [clang] Introduce diagnostics suppression mappings
This i
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/111375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -332,19 +334,22 @@ static void SetupSerializedDiagnostics(DiagnosticOptions
*DiagOpts,
void CompilerInstance::createDiagnostics(DiagnosticConsumer *Client,
bool ShouldOwnClient) {
- Diagnostics = createDiagnostics(&getDiagnosticOpt
kadircet wrote:
i remember mainly two concerns;
- we didn't want to surprise developers by breaking their builds as template
definitions needs to be visible at instantiation sites. so if we keep the
definition in the same file, just move it out-of-line, this should be fine.
- i remember AST was
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/111723
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -271,15 +271,24 @@ class FileSystem : public
llvm::ThreadSafeRefCountedBase,
/// Get the status of the entry at \p Path, if one exists.
virtual llvm::ErrorOr status(const Twine &Path) = 0;
- /// Get a \p File object for the file at \p Path, if one exists.
+ /// Get a
@@ -271,15 +271,24 @@ class FileSystem : public
llvm::ThreadSafeRefCountedBase,
/// Get the status of the entry at \p Path, if one exists.
virtual llvm::ErrorOr status(const Twine &Path) = 0;
- /// Get a \p File object for the file at \p Path, if one exists.
+ /// Get a
@@ -302,6 +305,17 @@ class RealFileSystem : public FileSystem {
return Storage;
}
+ ErrorOr> openFileForRead(const Twine &Name,
kadircet wrote:
it was quite confusing to see this as an overload, can you call it
`openFileForReadWithFlags` ?
https://gi
@@ -54,7 +54,9 @@ std::unique_ptr HeaderMap::Create(FileEntryRef FE,
FileManager &FM) {
unsigned FileSize = FE.getSize();
if (FileSize <= sizeof(HMapHeader)) return nullptr;
- auto FileBuffer = FM.getBufferForFile(FE);
+ auto FileBuffer =
+ FM.getBufferForFile(FE,
https://github.com/kadircet requested changes to this pull request.
thanks! I think this LG at a high-level, added some comments about the details.
I think it'd be worthwhile to add some tests (even if not now, probably going
forward). as otherwise such rare use cases might regress quite freque
@@ -292,21 +292,21 @@ class FileManager : public RefCountedBase {
/// MemoryBuffer if successful, otherwise returning null.
llvm::ErrorOr>
getBufferForFile(FileEntryRef Entry, bool isVolatile = false,
- bool RequiresNullTerminator = true,
+
kadircet wrote:
gentle ping @AaronBallman, I believe you were supportive of this approach in
final version of
[RFC](https://discourse.llvm.org/t/rfc-add-support-for-controlling-diagnostics-severities-at-file-level-granularity-through-command-line/81292/12?u=kadircet)
but I'd like to make sure
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) {
}
}
- clang::tooling::ClangTool Tool(OptionsParser->getCompilations(),
- OptionsParser->getSourcePathList());
+ auto VFS = llvm::vfs::getRealFileSystem();
+ auto &CDB = Option
https://github.com/kadircet approved this pull request.
thanks for bearing with me, LGTM!
https://github.com/llvm/llvm-project/pull/111375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) {
}
}
- clang::tooling::ClangTool Tool(OptionsParser->getCompilations(),
- OptionsParser->getSourcePathList());
+ auto VFS = llvm::vfs::getRealFileSystem();
+ auto &CDB = Option
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/111375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) {
}
}
- clang::tooling::ClangTool Tool(OptionsParser->getCompilations(),
- OptionsParser->getSourcePathList());
+ auto VFS = llvm::vfs::getRealFileSystem();
+ auto &CDB = Option
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
@@ -575,25 +575,42 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID,
SourceLocation Loc,
DiagID != diag::fatal_too_many_errors && Diag.FatalsAsError)
Result = diag::Severity::Error;
+ // Rest of the mappings are only applicable for diagnostics associated wit
@@ -575,25 +575,42 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID,
SourceLocation Loc,
DiagID != diag::fatal_too_many_errors && Diag.FatalsAsError)
Result = diag::Severity::Error;
+ // Rest of the mappings are only applicable for diagnostics associated wit
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/112517
From c0d2e4590308ebaaee78d7fe130a72b8586f6a88 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 14 Oct 2024 11:20:55 +0200
Subject: [PATCH 1/5] [clang] Introduce diagnostics suppression mappings
This i
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
@@ -946,6 +953,24 @@ class DiagnosticsEngine : public
RefCountedBase {
return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this);
}
+ /// Diagnostic suppression mappings can be used to ignore diagnostics based
on
+ /// the file they occur in. Mapping file is expect
@@ -108,6 +108,9 @@ class DiagnosticOptions : public
RefCountedBase{
/// The file to serialize diagnostics to (non-appending).
std::string DiagnosticSerializationFile;
+ /// File that defines suppression mappings.
kadircet wrote:
I was dropping that mos
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/112517
From 01a538fbbd93a7f26e1309c9c95d5be0c8500402 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 14 Oct 2024 11:20:55 +0200
Subject: [PATCH 1/3] [clang] Introduce diagnostics suppression mappings
This i
@@ -946,6 +952,13 @@ class DiagnosticsEngine : public
RefCountedBase {
return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this);
}
+ /// Diagnostic suppression mappings can be used to ignore diagnostics based
on
+ /// the file they occur in.
+ /// These take pres
kadircet wrote:
can you move these changes into
`clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc`? that's the
hand-curated version, we try to autogenerate the other one by parsing
cppreference.
https://github.com/llvm/llvm-project/pull/113796
__
https://github.com/kadircet requested changes to this pull request.
thanks a ton for the comprehensive change, i think this looks amazing!
can you just move the parser changes into a separate PR and revert changes in
the assertion and rather delete the duplicates from stdspecialsymbolmap?
http
@@ -232,6 +232,47 @@ SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
+// C++ [range.access.general]: ... the customization point objects
+// in [range.access] are available when the header is included.
+SYMBOL(begin, std::ranges::, )
@@ -232,6 +232,37 @@ SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
SYMBOL(ssize, std::, )
+// C++ [range.access.general]: ... the customization point objects
+// in [range.access] are available when the header is included.
+SYMBOL(begin, std::ranges::, )
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/113612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -115,15 +115,17 @@ static int initialize(Lang Language) {
NSLen = 0;
}
-if (SymIndex >= 0 &&
-Mapping->SymbolNames[SymIndex].qualifiedName() == QName) {
- // Not a new symbol, use the same index.
+if (SymIndex > 0) {
assert(llvm::none_o
@@ -352,20 +383,23 @@ SYMBOL(get, std::, /*no headers*/)
// providing the type.
SYMBOL(make_error_code, std::, /*no headers*/)
SYMBOL(make_error_condition, std::, /*no headers*/)
+// Similar to std::get, has variants for multiple containers
+// (vector, deque, list, etc.)
+SYMB
kadircet wrote:
can you send this in a separate PR ?
https://github.com/llvm/llvm-project/pull/113612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -127,50 +128,65 @@ struct ModuleFile {
std::string ModuleFilePath;
};
-bool IsModuleFileUpToDate(
-PathRef ModuleFilePath,
-const PrerequisiteModules &RequisiteModules) {
-IntrusiveRefCntPtr Diags =
- CompilerInstance::createDiagnostics(new DiagnosticOptions(
@@ -127,50 +128,65 @@ struct ModuleFile {
std::string ModuleFilePath;
};
-bool IsModuleFileUpToDate(
-PathRef ModuleFilePath,
-const PrerequisiteModules &RequisiteModules) {
-IntrusiveRefCntPtr Diags =
- CompilerInstance::createDiagnostics(new DiagnosticOptions(
https://github.com/kadircet requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/113879
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet approved this pull request.
thanks a lot, lgtm!
LMK if i should commit this for you
https://github.com/llvm/llvm-project/pull/113612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/113796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -115,15 +115,17 @@ static int initialize(Lang Language) {
NSLen = 0;
}
-if (SymIndex >= 0 &&
-Mapping->SymbolNames[SymIndex].qualifiedName() == QName) {
- // Not a new symbol, use the same index.
+if (SymIndex > 0) {
assert(llvm::none_o
@@ -411,6 +411,11 @@ SYMBOL(_27, std::placeholders::, )
SYMBOL(_28, std::placeholders::, )
SYMBOL(_29, std::placeholders::, )
+SYMBOL(binary_search, std::ranges::, )
kadircet wrote:
can you move this next to
https://github.com/llvm/llvm-project/blob/2de1fc82
https://github.com/kadircet approved this pull request.
thanks, lgtm!
let me know if i should land this for you
https://github.com/llvm/llvm-project/pull/113796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
https://github.com/kadircet requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106683
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -228,54 +223,30 @@ class StandalonePrerequisiteModules : public
PrerequisiteModules {
return BuiltModuleNames.contains(ModuleName);
}
- void addModuleFile(llvm::StringRef ModuleName,
- llvm::StringRef ModuleFilePath) {
-RequiredModules.emplac
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
https://github.com/kadircet requested changes to this pull request.
can we instead change the function return types to be `TidyProvider` ? unless
there's something we get by making these static lambdas (which isn't obvious to
me).
https://github.com/llvm/llvm-project/pull/114808
__
@@ -599,6 +600,19 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID,
SourceLocation Loc,
SM.isInSystemMacro(Loc))
return diag::Severity::Ignored;
+ // Apply suppression mappings if severity wasn't explicitly mapped with a
+ // clang-diagnostics pragma to ens
@@ -122,7 +122,6 @@ class SpecialCaseList {
// Returns zero if no match is found.
unsigned match(StringRef Query) const;
- private:
StringMap> Globs;
kadircet wrote:
thanks, and I'd like to address these in a follow-up refactoring, sent out
htt
@@ -70,6 +76,16 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
else
Diags.setExtensionHandlingBehavior(diag::Severity::Ignored);
+ if (!Opts.DiagnosticSuppressionMappingsFile.empty()) {
+if (auto Buf =
kadircet wrote:
sure, i think
@@ -167,4 +176,159 @@ TEST(DiagnosticTest, storedDiagEmptyWarning) {
// Make sure an empty warning can round-trip with \c StoredDiagnostic.
Diags.Report(CaptureConsumer.StoredDiags.front());
}
+
+class SuppressionMappingTest : public testing::Test {
kadirce
@@ -477,6 +485,100 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
kadircet wrote:
also see https://discourse.llvm.org/t/refac
kadircet wrote:
this is already tested in
https://github.com/llvm/llvm-project/pull/112517/files#diff-a8d03c054381627f238bdb8f7914daa4abebdae705d313dda026ce36eca0fe2fR327-R332
https://github.com/llvm/llvm-project/pull/112517
___
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/112517
From 20f1c1fea3466de38a04b5486cb05d95dbe3b96c Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 14 Oct 2024 11:20:55 +0200
Subject: [PATCH 1/7] [clang] Introduce diagnostics suppression mappings
This i
https://github.com/kadircet approved this pull request.
https://github.com/llvm/llvm-project/pull/114808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName,
if (Clang->getDiagnostics().hasErrorOccurred())
return llvm::createStringError("Compilation failed");
- BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output);
- return llv
@@ -122,7 +122,6 @@ class SpecialCaseList {
// Returns zero if no match is found.
unsigned match(StringRef Query) const;
- private:
StringMap> Globs;
kadircet wrote:
these are members of `SpecialCaseList::Matcher`. `WarningsSpecialCaseList` is
https://github.com/kadircet requested changes to this pull request.
thanks a lot for this patch!
I am not sure if this is a "good" fix-it for C++ ecosystem. As it'll make
suppression way easier. Today people needs to decide whether a suppression is
warranted, and explain it in a comment. at th
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/113612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/113612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet approved this pull request.
thanks, lgtm!
https://github.com/llvm/llvm-project/pull/113879
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/112517
From 20f1c1fea3466de38a04b5486cb05d95dbe3b96c Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 14 Oct 2024 11:20:55 +0200
Subject: [PATCH 1/6] [clang] Introduce diagnostics suppression mappings
This i
@@ -0,0 +1,92 @@
+
+Warning suppression mappings
+
+
+.. contents::
+ :local:
+
+Introduction
+
+
+Warning suppression mappings enables users to suppress clang's diagnostics in a
+per-file granular manner. Enabl
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
@@ -1315,6 +1319,29 @@ with its corresponding `Wno-` option.
Note that when combined with :option:`-w` (which disables all warnings),
disabling all warnings wins.
+.. _warning_suppression_mappings:
+
+Controlling Diagnostics via Suppression Mappings
+^^
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
@@ -70,6 +76,16 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
else
Diags.setExtensionHandlingBehavior(diag::Severity::Ignored);
+ if (!Opts.DiagnosticSuppressionMappingsFile.empty()) {
+if (auto Buf =
kadircet wrote:
i think
[Buf]
@@ -4493,6 +4493,13 @@ static void RenderDiagnosticsOptions(const Driver &D,
const ArgList &Args,
Args.addOptOutFlag(CmdArgs, options::OPT_fspell_checking,
options::OPT_fno_spell_checking);
+
+ if (const Arg *A =
+ Args.getLastArg(options::OPT
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor
Flavor,
setSeverity(Diag, Map, Loc);
}
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
+public:
+ static std::unique_ptr
+ create(const llvm::MemoryBuffer &MB, st
501 - 600 of 857 matches
Mail list logo