File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ namespace IGCMetrics
46
46
}
47
47
this ->map_InstrLoc2Func .clear ();
48
48
this ->map_Loops .clear ();
49
-
50
- // Optional: Delete all global objects allocated by libprotobuf.
51
- google::protobuf::ShutdownProtobufLibrary ();
52
49
#endif
53
50
}
54
51
bool IGCMetricImpl::Enable ()
@@ -427,6 +424,13 @@ namespace IGCMetrics
427
424
if (instr_call != nullptr )
428
425
{
429
426
auto calledFunc = instr_call->getCalledFunction ();
427
+
428
+ if (calledFunc == nullptr )
429
+ {
430
+ // TODO: Handle function pointers
431
+ continue ;
432
+ }
433
+
430
434
auto calledFuncName = calledFunc->getName ();
431
435
auto funcCallType = IGC_METRICS::FuncCalls_FuncCallsType::FuncCalls_FuncCallsType_INLINE;
432
436
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ using namespace llvm;
45
45
#if defined _WIN32 || _WIN64
46
46
// #if defined( _DEBUG )
47
47
#include " psapi.h"
48
+
49
+ #ifdef IGC_METRICS__PROTOBUF_ATTACHED
50
+ #include < google/protobuf/message_lite.h>
51
+ #endif
52
+
48
53
int CatchAssert ( int reportType, char *userMessage, int *retVal )
49
54
{
50
55
IGC_ASSERT (0 );
@@ -78,6 +83,11 @@ BOOL WINAPI DllMain(
78
83
switch (fdwReason) {
79
84
case DLL_PROCESS_DETACH:
80
85
llvm_shutdown ();
86
+
87
+ #ifdef IGC_METRICS__PROTOBUF_ATTACHED
88
+ // Optional: Delete all global objects allocated by libprotobuf.
89
+ google::protobuf::ShutdownProtobufLibrary ();
90
+ #endif
81
91
break ;
82
92
83
93
case DLL_PROCESS_ATTACH:
You can’t perform that action at this time.
0 commit comments