Skip to content

Conversation

@kadircet
Copy link
Member

@kadircet kadircet commented Feb 4, 2025

This gets rid of some extra IO from driver startup, and possiblity of
emitting warnings twice.

@kadircet kadircet requested a review from jyknight February 4, 2025 17:06
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Feb 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 4, 2025

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: kadir çetinkaya (kadircet)

Changes

This gets rid of some extra IO from driver startup, and possiblity of
emitting warnings twice.


Full diff: https://github.com/llvm/llvm-project/pull/125722.diff

1 Files Affected:

  • (modified) clang/tools/driver/driver.cpp (+4)
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 74923247b7ee16..00c00cea16f470 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -318,6 +318,10 @@ int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContext) {
 
   IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts =
       CreateAndPopulateDiagOpts(Args);
+  // Driver's diagnostics don't use suppression mappings, so don't bother
+  // parsing them. CC1 still receives full args, so this doesn't impact other
+  // actions.
+  DiagOpts->DiagnosticSuppressionMappingsFile.clear();
 
   TextDiagnosticPrinter *DiagClient
     = new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);

This gets rid of some extra IO from driver startup, and possiblity of
emitting warnings twice.
@kadircet kadircet force-pushed the dont_parse_wsm_driver branch from 7dce959 to 4b24e73 Compare February 6, 2025 09:01
@llvmbot llvmbot added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Feb 6, 2025
@kadircet kadircet merged commit df22bbe into llvm:main Feb 6, 2025
6 of 8 checks passed
@kadircet kadircet added this to the LLVM 20.X Release milestone Feb 6, 2025
@kadircet
Copy link
Member Author

kadircet commented Feb 6, 2025

/cherry-pick df22bbe

@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

/pull-request #126027

swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 7, 2025
)

This gets rid of some extra IO from driver startup, and possiblity of
emitting warnings twice.

(cherry picked from commit df22bbe)
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
)

This gets rid of some extra IO from driver startup, and possiblity of
emitting warnings twice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

Development

Successfully merging this pull request may close these issues.

3 participants