[MCJIT] Start Stringref-izing the ExecutionEngine interface.
authorLang Hames <lhames@gmail.com>
Mon, 15 Sep 2014 17:50:22 +0000 (17:50 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 15 Sep 2014 17:50:22 +0000 (17:50 +0000)
More methods to follow.

Using StringRef allows us the EE interface to work with more string types
without forcing construction of std::strings.

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

include/llvm/ExecutionEngine/ExecutionEngine.h
lib/ExecutionEngine/Interpreter/Interpreter.h
lib/ExecutionEngine/MCJIT/MCJIT.cpp
lib/ExecutionEngine/MCJIT/MCJIT.h

index 78dd8cd0f856d25fd970513c5d6a43b85cff50e9..5863d5759da6c4e2d4a1f5949bee7f0860adf5d5 100644 (file)
@@ -215,7 +215,7 @@ public:
   /// it prints a message to stderr and aborts.
   ///
   /// This function is deprecated for the MCJIT execution engine.
-  virtual void *getPointerToNamedFunction(const std::string &Name,
+  virtual void *getPointerToNamedFunction(StringRef Name,
                                           bool AbortOnFailure = true) = 0;
 
   /// mapSectionAddress - map a section to its target address space value.
index 70b07d5bece66c6b252f91b913b6b851ea4ae671..0b620d1f8d7c840a31ed50d1ee1aa7cac5d5813e 100644 (file)
@@ -116,7 +116,7 @@ public:
   GenericValue runFunction(Function *F,
                            const std::vector<GenericValue> &ArgValues) override;
 
-  void *getPointerToNamedFunction(const std::string &Name,
+  void *getPointerToNamedFunction(StringRef Name,
                                   bool AbortOnFailure = true) override {
     // FIXME: not implemented.
     return nullptr;
index e441ec8d1a33e3a7d1c966f804495cded640ebe9..4cf3e2044dfffa769bfcac49d87a278d0d35ee88 100644 (file)
@@ -517,8 +517,7 @@ GenericValue MCJIT::runFunction(Function *F,
   llvm_unreachable("Full-featured argument passing not supported yet!");
 }
 
-void *MCJIT::getPointerToNamedFunction(const std::string &Name,
-                                       bool AbortOnFailure) {
+void *MCJIT::getPointerToNamedFunction(StringRef Name, bool AbortOnFailure) {
   if (!isSymbolSearchingDisabled()) {
     void *ptr = MemMgr.getPointerToNamedFunction(Name, false);
     if (ptr)
index 624a4317a3b7e284347d4c6753d02a9087139393..bc943b9b886643ff020a4f91cfc56732a6e7d869 100644 (file)
@@ -293,7 +293,7 @@ public:
   /// found, this function silently returns a null pointer. Otherwise,
   /// it prints a message to stderr and aborts.
   ///
-  void *getPointerToNamedFunction(const std::string &Name,
+  void *getPointerToNamedFunction(StringRef Name,
                                   bool AbortOnFailure = true) override;
 
   /// mapSectionAddress - map a section to its target address space value.