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
4646 }
4747 this ->map_InstrLoc2Func .clear ();
4848 this ->map_Loops .clear ();
49-
50- // Optional: Delete all global objects allocated by libprotobuf.
51- google::protobuf::ShutdownProtobufLibrary ();
5249#endif
5350 }
5451 bool IGCMetricImpl::Enable ()
@@ -427,6 +424,13 @@ namespace IGCMetrics
427424 if (instr_call != nullptr )
428425 {
429426 auto calledFunc = instr_call->getCalledFunction ();
427+
428+ if (calledFunc == nullptr )
429+ {
430+ // TODO: Handle function pointers
431+ continue ;
432+ }
433+
430434 auto calledFuncName = calledFunc->getName ();
431435 auto funcCallType = IGC_METRICS::FuncCalls_FuncCallsType::FuncCalls_FuncCallsType_INLINE;
432436
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ using namespace llvm;
4545#if defined _WIN32 || _WIN64
4646// #if defined( _DEBUG )
4747#include " psapi.h"
48+
49+ #ifdef IGC_METRICS__PROTOBUF_ATTACHED
50+ #include < google/protobuf/message_lite.h>
51+ #endif
52+
4853int CatchAssert ( int reportType, char *userMessage, int *retVal )
4954{
5055 IGC_ASSERT (0 );
@@ -78,6 +83,11 @@ BOOL WINAPI DllMain(
7883 switch (fdwReason) {
7984 case DLL_PROCESS_DETACH:
8085 llvm_shutdown ();
86+
87+ #ifdef IGC_METRICS__PROTOBUF_ATTACHED
88+ // Optional: Delete all global objects allocated by libprotobuf.
89+ google::protobuf::ShutdownProtobufLibrary ();
90+ #endif
8191 break ;
8292
8393 case DLL_PROCESS_ATTACH:
You can’t perform that action at this time.
0 commit comments