Skip to content
Snippets Groups Projects
Commit 52eb3557 authored by Chandler Carruth's avatar Chandler Carruth
Browse files

[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
parent 6075fa12
No related branches found
No related tags found
No related merge requests found
...@@ -114,10 +114,6 @@ std::error_code ObjectFile::parse() { ...@@ -114,10 +114,6 @@ std::error_code ObjectFile::parse() {
return initializeSymbols(); return initializeSymbols();
} }
SymbolBody *ObjectFile::getSymbolBody(uint32_t SymbolIndex) {
return SparseSymbolBodies[SymbolIndex]->getReplacement();
}
std::error_code ObjectFile::initializeChunks() { std::error_code ObjectFile::initializeChunks() {
uint32_t NumSections = COFFObj->getNumberOfSections(); uint32_t NumSections = COFFObj->getNumberOfSections();
Chunks.reserve(NumSections); Chunks.reserve(NumSections);
......
...@@ -101,7 +101,9 @@ public: ...@@ -101,7 +101,9 @@ public:
// Returns a SymbolBody object for the SymbolIndex'th symbol in the // Returns a SymbolBody object for the SymbolIndex'th symbol in the
// underlying object file. // underlying object file.
SymbolBody *getSymbolBody(uint32_t SymbolIndex); SymbolBody *getSymbolBody(uint32_t SymbolIndex) {
return SparseSymbolBodies[SymbolIndex]->getReplacement();
}
// Returns the underying COFF file. // Returns the underying COFF file.
COFFObjectFile *getCOFFObj() { return COFFObj.get(); } COFFObjectFile *getCOFFObj() { return COFFObj.get(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment