Skip to content

Commit

Permalink
[MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217263 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lhames committed Sep 5, 2014
1 parent 1774832 commit 9f1eb4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/llvm/ExecutionEngine/RuntimeDyld.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ class RuntimeDyld {
/// 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.
uint64_t getSymbolLoadAddress(StringRef Name);
uint64_t getSymbolLoadAddress(StringRef Name) const;

/// Resolve the relocations for all symbols we currently know about.
void resolveRelocations();
Expand Down
4 changes: 2 additions & 2 deletions lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,13 +871,13 @@ RuntimeDyld::loadObject(std::unique_ptr<ObjectBuffer> InputBuffer) {
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);
}

uint64_t RuntimeDyld::getSymbolLoadAddress(StringRef Name) {
uint64_t RuntimeDyld::getSymbolLoadAddress(StringRef Name) const {
if (!Dyld)
return 0;
return Dyld->getSymbolLoadAddress(Name);
Expand Down
8 changes: 4 additions & 4 deletions lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ class RuntimeDyldImpl {
return true;
}

uint64_t getSectionLoadAddress(unsigned SectionID) {
uint64_t getSectionLoadAddress(unsigned SectionID) const {
return Sections[SectionID].LoadAddress;
}

uint8_t *getSectionAddress(unsigned SectionID) {
uint8_t *getSectionAddress(unsigned SectionID) const {
return (uint8_t *)Sections[SectionID].Address;
}

Expand Down Expand Up @@ -376,7 +376,7 @@ class RuntimeDyldImpl {
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);
Expand All @@ -386,7 +386,7 @@ class RuntimeDyldImpl {
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);
Expand Down

0 comments on commit 9f1eb4d

Please sign in to comment.