summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-11-23 19:19:11 +0000
committerTeresa Johnson <tejohnson@google.com>2015-11-23 19:19:11 +0000
commit6b92316811e1d3be74ab0f535efcd3918853f2f6 (patch)
tree4c0376172206347c58f89ac2624c4f5b0713d49c /llvm/include
parentd0430e85808b2ef6f71d0383b201d608b0d1955a (diff)
downloadbcm5719-llvm-6b92316811e1d3be74ab0f535efcd3918853f2f6.tar.gz
bcm5719-llvm-6b92316811e1d3be74ab0f535efcd3918853f2f6.zip
[ThinLTO] Deduplicate function index loading into shared helper (NFC)
Add a shared helper routine to read the function index from a file and create/return the function index object. Use it in llvm-link and llvm-lto. llvm-svn: 253903
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Object/FunctionIndexObjectFile.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/Object/FunctionIndexObjectFile.h b/llvm/include/llvm/Object/FunctionIndexObjectFile.h
index 92b670db49a..511a237881e 100644
--- a/llvm/include/llvm/Object/FunctionIndexObjectFile.h
+++ b/llvm/include/llvm/Object/FunctionIndexObjectFile.h
@@ -99,6 +99,13 @@ public:
StringRef FunctionName);
};
}
+
+/// Parse the function index out of an IR file and return the function
+/// index object if found, or nullptr if not.
+ErrorOr<std::unique_ptr<FunctionInfoIndex>>
+getFunctionIndexForFile(StringRef Path,
+ DiagnosticHandlerFunction DiagnosticHandler,
+ const Module *ExportingModule = nullptr);
}
#endif
OpenPOWER on IntegriCloud