[MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.
authorLang Hames <lhames@gmail.com>
Fri, 5 Sep 2014 18:00:16 +0000 (18:00 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 5 Sep 2014 18:00:16 +0000 (18:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217263 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/RuntimeDyld.h
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h

index 7e6305d5615a4b797f25b8737effa09dcb552f3d..3605b9e44d762d933bff752dc65e8ce3de988494 100644 (file)
@@ -66,11 +66,11 @@ public:
   /// Get the address of our local copy of the symbol. This may or may not
   /// be the address used for relocation (clients can copy the data around
   /// and resolve relocatons based on where they put it).
   /// Get the address of our local copy of the symbol. This may or may not
   /// be the address used for relocation (clients can copy the data around
   /// and resolve relocatons based on where they put it).
-  void *getSymbolAddress(StringRef Name);
+  void *getSymbolAddress(StringRef Name) const;
 
   /// Get the address of the target copy of the symbol. This is the address
   /// used for relocation.
 
   /// Get the address of the target copy of the symbol. This is the address
   /// used for relocation.
-  uint64_t getSymbolLoadAddress(StringRef Name);
+  uint64_t getSymbolLoadAddress(StringRef Name) const;
 
   /// Resolve the relocations for all symbols we currently know about.
   void resolveRelocations();
 
   /// Resolve the relocations for all symbols we currently know about.
   void resolveRelocations();
index 5a178763b5061041337ad401a293759b789f453a..06359b7f02be68588a28d0bb6b10b0cbef0a7dd5 100644 (file)
@@ -871,13 +871,13 @@ RuntimeDyld::loadObject(std::unique_ptr<ObjectBuffer> InputBuffer) {
   return Dyld->loadObject(std::move(InputImage));
 }
 
   return Dyld->loadObject(std::move(InputImage));
 }
 
-void *RuntimeDyld::getSymbolAddress(StringRef Name) {
+void *RuntimeDyld::getSymbolAddress(StringRef Name) const {
   if (!Dyld)
     return nullptr;
   return Dyld->getSymbolAddress(Name);
 }
 
   if (!Dyld)
     return nullptr;
   return Dyld->getSymbolAddress(Name);
 }
 
-uint64_t RuntimeDyld::getSymbolLoadAddress(StringRef Name) {
+uint64_t RuntimeDyld::getSymbolLoadAddress(StringRef Name) const {
   if (!Dyld)
     return 0;
   return Dyld->getSymbolLoadAddress(Name);
   if (!Dyld)
     return 0;
   return Dyld->getSymbolLoadAddress(Name);
index 53ea370196d734bebc78a9d2d65dceb30b10db3d..69ea3b4f4e6824fc4d124f5146d651c36d077c83 100644 (file)
@@ -249,11 +249,11 @@ protected:
     return true;
   }
 
     return true;
   }
 
-  uint64_t getSectionLoadAddress(unsigned SectionID) {
+  uint64_t getSectionLoadAddress(unsigned SectionID) const {
     return Sections[SectionID].LoadAddress;
   }
 
     return Sections[SectionID].LoadAddress;
   }
 
-  uint8_t *getSectionAddress(unsigned SectionID) {
+  uint8_t *getSectionAddress(unsigned SectionID) const {
     return (uint8_t *)Sections[SectionID].Address;
   }
 
     return (uint8_t *)Sections[SectionID].Address;
   }
 
@@ -376,7 +376,7 @@ public:
   std::unique_ptr<ObjectImage>
   loadObject(std::unique_ptr<ObjectImage> InputObject);
 
   std::unique_ptr<ObjectImage>
   loadObject(std::unique_ptr<ObjectImage> InputObject);
 
-  uint8_t* getSymbolAddress(StringRef Name) {
+  uint8_t* getSymbolAddress(StringRef Name) const {
     // FIXME: Just look up as a function for now. Overly simple of course.
     // Work in progress.
     SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
     // FIXME: Just look up as a function for now. Overly simple of course.
     // Work in progress.
     SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
@@ -386,7 +386,7 @@ public:
     return getSectionAddress(Loc.first) + Loc.second;
   }
 
     return getSectionAddress(Loc.first) + Loc.second;
   }
 
-  uint64_t getSymbolLoadAddress(StringRef Name) {
+  uint64_t getSymbolLoadAddress(StringRef Name) const {
     // FIXME: Just look up as a function for now. Overly simple of course.
     // Work in progress.
     SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);
     // FIXME: Just look up as a function for now. Overly simple of course.
     // Work in progress.
     SymbolTableMap::const_iterator pos = GlobalSymbolTable.find(Name);