[PATCH] Repair IntelJITEventListener

Arch D. Robison arch.robison at intel.com
Fri Apr 4 12:56:15 PDT 2014


Hi #llvm,

Recent changes broke `IntelJITEventListener` and its unit test.  The patch fixes the breaks and eliminates a gcc warning.

Summary of changes:

  - Change `take()` to `release()`, because `MockWrapper` went from being an `OwningPtr` to a `std::unique_ptr`.
  - Repair form of loop since  r200442 removed  `content_iterator::increment`.  The change mimics a similar change made by r200442 to `lib/DebugInfo/DWARFContext.cpp` 
  - Use a const_cast instead of C-style cast to shut up a warning from gcc.

- Arch

http://llvm-reviews.chandlerc.com/D3293

Files:
  unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp
  lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp

Index: unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp
===================================================================
--- unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp
+++ unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp
@@ -83,7 +83,7 @@
     EXPECT_TRUE(0 != MockWrapper);
 
     Listener.reset(JITEventListener::createIntelJITEventListener(
-      MockWrapper.take()));
+      MockWrapper.release()));
     EXPECT_TRUE(0 != Listener);
     EE->RegisterJITEventListener(Listener.get());
   }
Index: lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
===================================================================
--- lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
+++ lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
@@ -193,11 +193,10 @@
   MethodAddressVector Functions;
 
   // Use symbol info to iterate functions in the object.
-  error_code ec;
   for (object::symbol_iterator I = Obj.begin_symbols(),
                                E = Obj.end_symbols();
-                        I != E && !ec;
-                        I.increment(ec)) {
+                        I != E;
+                        ++I) {
     std::vector<LineNumberInfo> LineInfo;
     std::string SourceFileName;
 
@@ -234,7 +233,7 @@
           FunctionMessage.line_number_table = 0;
         } else {
           SourceFileName = Lines.front().second.getFileName();
-          FunctionMessage.source_file_name = (char *)SourceFileName.c_str();
+          FunctionMessage.source_file_name = const_cast<char *>(SourceFileName.c_str());
           FunctionMessage.line_number_size = LineInfo.size();
           FunctionMessage.line_number_table = &*LineInfo.begin();
         }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3293.1.patch
Type: text/x-patch
Size: 1736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140404/8ab676ff/attachment.bin>


More information about the llvm-commits mailing list