diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-06-27 06:40:10 +0300 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-06-27 06:40:10 +0300 |
commit | 52eb35576572614ebd37c4904255e7fa3fc7d01b (patch) | |
tree | 8ab99f7bb42363928e011e56ed861ef08c96a0d1 /lld/COFF | |
parent | 6075fa12734fa95c9fb3b09419d57fbe0f5ba5b2 (diff) |
[opt] Inline a trivial lookup function into the header.
This function is actually *very* hot. It is hard to see currently
because the call graph is very recursive, but I'm working to remove that
and when I do this function becomes significantly higher on the profile
(up to 5%!) and so worth avoiding the call overhead.
No specific perf gain I can measure yet (below the noise), but likely to
have more impact as we stop cluttering the call graph.
Differential Revision: http://reviews.llvm.org/D10788
llvm-svn: 240873
Diffstat (limited to 'lld/COFF')
-rw-r--r-- | lld/COFF/InputFiles.cpp | 4 | ||||
-rw-r--r-- | lld/COFF/InputFiles.h | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 5dc72270da58..61f0b6331404 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -114,10 +114,6 @@ std::error_code ObjectFile::parse() { return initializeSymbols(); } -SymbolBody *ObjectFile::getSymbolBody(uint32_t SymbolIndex) { - return SparseSymbolBodies[SymbolIndex]->getReplacement(); -} - std::error_code ObjectFile::initializeChunks() { uint32_t NumSections = COFFObj->getNumberOfSections(); Chunks.reserve(NumSections); diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h index 4a43444e958d..7a1ef56ec025 100644 --- a/lld/COFF/InputFiles.h +++ b/lld/COFF/InputFiles.h @@ -101,7 +101,9 @@ public: // Returns a SymbolBody object for the SymbolIndex'th symbol in the // underlying object file. - SymbolBody *getSymbolBody(uint32_t SymbolIndex); + SymbolBody *getSymbolBody(uint32_t SymbolIndex) { + return SparseSymbolBodies[SymbolIndex]->getReplacement(); + } // Returns the underying COFF file. COFFObjectFile *getCOFFObj() { return COFFObj.get(); } |