Skip to content

Commit 77eb6cd

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:f9906508bc4f into amd-gfx:aab4d6b3f6fc
Local branch amd-gfx aab4d6b Merged main:7d7e4d20b077 into amd-gfx:b98ebf3e2b96 Remote branch main f990650 [analyzer][NFC] Substitute operator() with lambda in StreamChecker
2 parents aab4d6b + f990650 commit 77eb6cd

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -407,23 +407,14 @@ class StreamChecker : public Checker<check::PreCall, eval::Call,
407407

408408
/// Generate a message for BugReporterVisitor if the stored symbol is
409409
/// marked as interesting by the actual bug report.
410-
// FIXME: Use lambda instead.
411-
struct NoteFn {
412-
const BugType *BT_ResourceLeak;
413-
SymbolRef StreamSym;
414-
std::string Message;
415-
416-
std::string operator()(PathSensitiveBugReport &BR) const {
417-
if (BR.isInteresting(StreamSym) && &BR.getBugType() == BT_ResourceLeak)
418-
return Message;
419-
420-
return "";
421-
}
422-
};
423-
424410
const NoteTag *constructNoteTag(CheckerContext &C, SymbolRef StreamSym,
425411
const std::string &Message) const {
426-
return C.getNoteTag(NoteFn{&BT_ResourceLeak, StreamSym, Message});
412+
return C.getNoteTag([this, StreamSym,
413+
Message](PathSensitiveBugReport &BR) -> std::string {
414+
if (BR.isInteresting(StreamSym) && &BR.getBugType() == &BT_ResourceLeak)
415+
return Message;
416+
return "";
417+
});
427418
}
428419

429420
const NoteTag *constructSetEofNoteTag(CheckerContext &C,

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 478253
19+
#define LLVM_MAIN_REVISION 478254
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)