[clang] 9d6df77 - [Clang] [NFC] Inline static helper function in `Compilation.cpp` (#152875)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 10 00:54:22 PDT 2025


Author: Thibault Monnier
Date: 2025-08-10T09:54:19+02:00
New Revision: 9d6df77c8928ce27bab612d16a3d5c4884903b0d

URL: https://github.com/llvm/llvm-project/commit/9d6df77c8928ce27bab612d16a3d5c4884903b0d
DIFF: https://github.com/llvm/llvm-project/commit/9d6df77c8928ce27bab612d16a3d5c4884903b0d.diff

LOG: [Clang] [NFC] Inline static helper function in `Compilation.cpp` (#152875)

This PR inlines the static `InputsOk` function in clang
`Compilation.cpp` driver, because it was just a simple function call and
was called only once. In addition, inlining it allows removing the
double negation.

Added: 
    

Modified: 
    clang/lib/Driver/Compilation.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index a39952e3c280a..4e300316ae9ba 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -232,11 +232,6 @@ static bool ActionFailed(const Action *A,
   return false;
 }
 
-static bool InputsOk(const Command &C,
-                     const FailingCommandList &FailingCommands) {
-  return !ActionFailed(&C.getSource(), FailingCommands);
-}
-
 void Compilation::ExecuteJobs(const JobList &Jobs,
                               FailingCommandList &FailingCommands,
                               bool LogOnly) const {
@@ -245,7 +240,7 @@ void Compilation::ExecuteJobs(const JobList &Jobs,
   // In all but CLMode, execute all the jobs unless the necessary inputs for the
   // job is missing due to previous failures.
   for (const auto &Job : Jobs) {
-    if (!InputsOk(Job, FailingCommands))
+    if (ActionFailed(&Job.getSource(), FailingCommands))
       continue;
     const Command *FailingCommand = nullptr;
     if (int Res = ExecuteCommand(Job, FailingCommand, LogOnly)) {


        


More information about the cfe-commits mailing list