From 480763f814eef6e983eb1042f6c294a1501005a5 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 29 Jul 2014 20:40:37 +0000 Subject: [MCJIT] Make the RuntimeDyldChecker stub_addr builtin use file names rather than full paths for its first argument. This allows us to remove the annoying sed lines in the test cases, and write direct references to file names in stub_addr calls (rather than placeholders). llvm-svn: 214211 --- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 4 +++- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 308d80ef95e..135444f9b5b 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -13,6 +13,7 @@ #include "llvm/MC/MCDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/Support/StringRefMemoryObject.h" +#include "llvm/Support/Path.h" #include "RuntimeDyldCheckerImpl.h" #include "RuntimeDyldImpl.h" #include @@ -772,8 +773,9 @@ RuntimeDyldCheckerImpl::getSubsectionStartingAt(StringRef Name) const { } void RuntimeDyldCheckerImpl::registerStubMap( - StringRef FileName, unsigned SectionID, + StringRef FilePath, unsigned SectionID, const RuntimeDyldImpl::StubMap &RTDyldStubs) { + StringRef FileName = sys::path::filename(FilePath); const SectionEntry &Section = getRTDyld().Sections[SectionID]; StringRef SectionName = Section.Name; for (auto &StubMapEntry : RTDyldStubs) { diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h index 8adde62448a..b3b16da5210 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h @@ -34,7 +34,7 @@ private: uint64_t getSymbolLinkerAddr(StringRef Symbol) const; uint64_t getSymbolRemoteAddr(StringRef Symbol) const; uint64_t readMemoryAtAddr(uint64_t Addr, unsigned Size) const; - std::pair getStubAddrFor(StringRef FileName, + std::pair getStubAddrFor(StringRef FilePath, StringRef SectionName, StringRef Symbol, bool IsInsideLoad) const; -- cgit v1.2.3