[llvm] r333230 - [C-API] Add functions to create GDB, Intel, Oprofile event listeners.

Andres Freund via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 14:32:54 PDT 2018


Author: anarazel
Date: Thu May 24 14:32:54 2018
New Revision: 333230

URL: http://llvm.org/viewvc/llvm-project?rev=333230&view=rev
Log:
[C-API] Add functions to create GDB, Intel, Oprofile event listeners.

The additions of Intel, Oprofile listeners were done blindly.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D44890

Modified:
    llvm/trunk/include/llvm-c/ExecutionEngine.h
    llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h
    llvm/trunk/lib/ExecutionEngine/GDBRegistrationListener.cpp
    llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
    llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp

Modified: llvm/trunk/include/llvm-c/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/ExecutionEngine.h?rev=333230&r1=333229&r2=333230&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm-c/ExecutionEngine.h Thu May 24 14:32:54 2018
@@ -182,6 +182,12 @@ LLVMMCJITMemoryManagerRef LLVMCreateSimp
 
 void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
 
+/*===-- JIT Event Listener functions -------------------------------------===*/
+
+LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void);
+LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
+LLVMJITEventListenerRef LLVMCreateOprofileJITEventListener(void);
+
 /**
  * @}
  */

Modified: llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h?rev=333230&r1=333229&r2=333230&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h Thu May 24 14:32:54 2018
@@ -125,4 +125,16 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEv
 
 } // end namespace llvm
 
+#ifndef LLVM_USE_INTEL_JITEVENTS
+LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void) {
+  return nullptr;
+}
+#endif
+
+#ifndef LLVM_USE_OPROFILE
+LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void) {
+  return nullptr;
+}
+#endif
+
 #endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H

Modified: llvm/trunk/lib/ExecutionEngine/GDBRegistrationListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/GDBRegistrationListener.cpp?rev=333230&r1=333229&r2=333230&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/GDBRegistrationListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/GDBRegistrationListener.cpp Thu May 24 14:32:54 2018
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm-c/ExecutionEngine.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
 #include "llvm/Object/ObjectFile.h"
@@ -235,3 +236,8 @@ JITEventListener* JITEventListener::crea
 }
 
 } // namespace llvm
+
+LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void)
+{
+  return wrap(JITEventListener::createGDBRegistrationListener());
+}

Modified: llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp?rev=333230&r1=333229&r2=333230&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp Thu May 24 14:32:54 2018
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "IntelJITEventsWrapper.h"
+#include "llvm-c/ExecutionEngine.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Config/config.h"
@@ -238,3 +239,7 @@ JITEventListener *JITEventListener::crea
 
 } // namespace llvm
 
+LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
+{
+  return wrap(JITEventListener::createIntelJITEventListener());
+}

Modified: llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp?rev=333230&r1=333229&r2=333230&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp Thu May 24 14:32:54 2018
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm-c/ExecutionEngine.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Config/config.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
@@ -158,3 +159,7 @@ JITEventListener *JITEventListener::crea
 
 } // namespace llvm
 
+LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
+{
+  return wrap(JITEventListener::createOProfileJITEventListener());
+}




More information about the llvm-commits mailing list