Skip to content

Commit 44d037c

Browse files
authored
Change type of DiagnosticHandlerTy (#86504)
Changing type of DiagnosticHandlerTy due to adding -Wcast-function-type-mismatch to -Wextra group(#86131 (comment)). Changed the reference argument DiagnosticInfo to a pointer and edited the test cases failing due to this change. Added another small change where Gtest api was throwing an warning due varargs argument not being passed.
1 parent 2f63718 commit 44d037c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

llvm/include/llvm/IR/DiagnosticHandler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct DiagnosticHandler {
2828
: DiagnosticContext(DiagContext) {}
2929
virtual ~DiagnosticHandler() = default;
3030

31-
using DiagnosticHandlerTy = void (*)(const DiagnosticInfo &DI, void *Context);
31+
using DiagnosticHandlerTy = void (*)(const DiagnosticInfo *DI, void *Context);
3232

3333
/// DiagHandlerCallback is settable from the C API and base implementation
3434
/// of DiagnosticHandler will call it from handleDiagnostics(). Any derived
@@ -42,7 +42,7 @@ struct DiagnosticHandler {
4242
/// with a prefix based on the severity.
4343
virtual bool handleDiagnostics(const DiagnosticInfo &DI) {
4444
if (DiagHandlerCallback) {
45-
DiagHandlerCallback(DI, DiagnosticContext);
45+
DiagHandlerCallback(&DI, DiagnosticContext);
4646
return true;
4747
}
4848
return false;

llvm/unittests/Linker/LinkModulesTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class LinkModuleTest : public testing::Test {
7272
BasicBlock *ExitBB;
7373
};
7474

75-
static void expectNoDiags(const DiagnosticInfo &DI, void *C) {
75+
static void expectNoDiags(const DiagnosticInfo *DI, void *C) {
7676
llvm_unreachable("expectNoDiags called!");
7777
}
7878

llvm/unittests/Support/ThreadPool.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ using ThreadPoolImpls = ::testing::Types<
126126
#endif
127127
SingleThreadExecutor>;
128128

129-
TYPED_TEST_SUITE(ThreadPoolTest, ThreadPoolImpls);
129+
TYPED_TEST_SUITE(ThreadPoolTest, ThreadPoolImpls, );
130130

131131
#define CHECK_UNSUPPORTED() \
132132
do { \

0 commit comments

Comments
 (0)