github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- 
clang/lib/StaticAnalyzer/Checkers/LifetimeAnnotations.cpp 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/LifetimeAnnotations.cpp 
b/clang/lib/StaticAnalyzer/Checkers/LifetimeAnnotations.cpp
index 4052e1385..c8a3eccec 100644
--- a/clang/lib/StaticAnalyzer/Checkers/LifetimeAnnotations.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/LifetimeAnnotations.cpp
@@ -1,18 +1,16 @@
+#include "clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h"
+#include "AllocationState.h"
 #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
-#include "AllocationState.h"
-#include "clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h"
-
 
 using namespace clang;
 using namespace ento;
 using namespace clang::lifetimes;
 
-REGISTER_MAP_WITH_PROGRAMSTATE(LifetimeBoundMap, SymbolRef,
-                               const MemRegion *);
+REGISTER_MAP_WITH_PROGRAMSTATE(LifetimeBoundMap, SymbolRef, const MemRegion *);
 
 class LifetimeAnnotations : public Checker<check::PostCall> {
 public:
@@ -48,7 +46,7 @@ void LifetimeAnnotations::checkPostCall(const CallEvent &Call,
   SVal RetVal = Call.getReturnValue();
 
   SymbolRef RetValSym = RetVal.getAsSymbol(/*IncludeBaseRegions=*/true);
-  if(!RetValSym)
+  if (!RetValSym)
     return;
 
   if (LBParamIdx != FD->getNumParams()) {
@@ -57,7 +55,7 @@ void LifetimeAnnotations::checkPostCall(const CallEvent &Call,
     // FIXME: if(!ArgValRegion) should be also handled since in those cases
     // the argument has no region, but still needs to be tracked.
     if (ArgValRegion)
-        State = State->set<LifetimeBoundMap>(RetValSym, ArgValRegion);
+      State = State->set<LifetimeBoundMap>(RetValSym, ArgValRegion);
   }
 
   if (const auto *IC = dyn_cast<CXXInstanceCall>(&Call)) {
@@ -65,7 +63,7 @@ void LifetimeAnnotations::checkPostCall(const CallEvent &Call,
       const MemRegion *AttrRegion = IC->getCXXThisVal().getAsRegion();
 
       if (AttrRegion)
-          State = State->set<LifetimeBoundMap>(RetValSym, AttrRegion);
+        State = State->set<LifetimeBoundMap>(RetValSym, AttrRegion);
     }
   }
   C.addTransition(State);
@@ -79,7 +77,7 @@ void LifetimeAnnotations::printState(raw_ostream &Out, 
ProgramStateRef State,
     return;
 
   Out << Sep << "LifetimeBound bindings:" << NL;
-  for (auto&& [RetValSym, ArgValRegion] : LBVal) {
+  for (auto &&[RetValSym, ArgValRegion] : LBVal) {
     Out << " Origin " << RetValSym << " contains Loan " << ArgValRegion << NL;
   }
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/200145
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to