Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jul 2015 21:47:00 +0000 (21:47 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jul 2015 21:47:00 +0000 (21:47 +0000)
Is anyone using those?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241372 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
tools/llvm-jitlistener/CMakeLists.txt

index 907144007fdd52035c9d068d9a8fc663903146fd..4e7d209b7b414ba6bc6db9094345bda86df3518f 100644 (file)
@@ -118,9 +118,10 @@ void IntelJITEventListener::NotifyObjectEmitted(
       if (!Name)
         continue;
 
-      uint64_t Addr;
-      if (Sym.getAddress(Addr))
+      ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
+      if (AddrOrErr.getError())
         continue;
+      uint64_t Addr = *AddrOrErr;
       uint64_t Size = P.second;
 
       // Record this address in a local vector
index b72033805269fc6527e80af2fa8e5adaeab57496..d2fc4c784ec79c74bc2083ad641dde8ab34d9a61 100644 (file)
@@ -89,12 +89,14 @@ void OProfileJITEventListener::NotifyObjectEmitted(
   for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
     SymbolRef Sym = P.first;
     if (Sym.getType() == SymbolRef::ST_Function) {
-      StringRef  Name;
-      uint64_t   Addr;
-      if (Sym.getName(Name))
+      ErrorOr<StringRef> NameOrErr = Sym.getName();
+      if (NameOrErr.getError())
         continue;
-      if (Sym.getAddress(Addr))
+      StringRef Name = *NameOrErr;
+      ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
+      if (AddrOrErr.getError())
         continue;
+      uint64_t Addr = *AddrOrErr;
       uint64_t Size = P.second;
 
       if (Wrapper->op_write_native_code(Name.data(), Addr, (void*)Addr, Size)
@@ -126,8 +128,10 @@ void OProfileJITEventListener::NotifyFreeingObject(const ObjectFile &Obj) {
                          E = DebugObj.symbol_end();
          I != E; ++I) {
       if (I->getType() == SymbolRef::ST_Function) {
-        uint64_t   Addr;
-        if (I->getAddress(Addr)) continue;
+        ErrorOr<uint64_t> AddrOrErr = I->getAddress();
+        if (AddrOrErr.getError())
+          continue;
+        uint64_t Addr = *AddrOrErr;
 
         if (Wrapper->op_unload_native_code(Addr) == -1) {
           DEBUG(dbgs()
index 68a4303acef0fdda8d4d773c16c7cac1baea10bd..e2b30e1950ee9a6588530300d5a34a1d0ee6e45a 100644 (file)
@@ -6,7 +6,7 @@ include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
 set(LLVM_LINK_COMPONENTS
   asmparser
   bitreader
-  debuginfo
+  DebugInfoDWARF
   inteljitevents
   interpreter
   irreader