[llvm] r329175 - [llvm-exegesis][NFC] Fix compilation warning.

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 05:01:43 PDT 2018


Author: courbet
Date: Wed Apr  4 05:01:43 2018
New Revision: 329175

URL: http://llvm.org/viewvc/llvm-project?rev=329175&view=rev
Log:
[llvm-exegesis][NFC] Fix compilation warning.

Modified:
    llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.h

Modified: llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.h?rev=329175&r1=329174&r2=329175&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.h (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.h Wed Apr  4 05:01:43 2018
@@ -65,7 +65,10 @@ public:
   llvm::StringRef getFunctionBytes() const { return FunctionBytes; }
 
   // Retrieves the callable function.
-  void operator()() const { ((void (*)())FunctionBytes.data())(); }
+  void operator()() const {
+    char* const FnData = const_cast<char*>(FunctionBytes.data());
+    ((void (*)())FnData)();
+  }
 
 private:
   JitFunctionContext FunctionContext;




More information about the llvm-commits mailing list