summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-10-06 01:22:42 +0000
committerBill Wendling <isanbard@gmail.com>2010-10-06 01:22:42 +0000
commit0198ce06fc571de7b6dc4c416a316781a2344a6c (patch)
treef10bd06b116d3ae791be7b927a26ac431eb4bb69 /llvm/tools
parent1fc81e90f734d8dd81f8851580d16d88152c876e (diff)
downloadbcm5719-llvm-0198ce06fc571de7b6dc4c416a316781a2344a6c.tar.gz
bcm5719-llvm-0198ce06fc571de7b6dc4c416a316781a2344a6c.zip
Provide a fast "get me the target triple from the module" API. This can
drastically reduce the linking time during LTO. Patch by Shantonu Sen! llvm-svn: 115728
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lto/LTOModule.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/tools/lto/LTOModule.cpp b/llvm/tools/lto/LTOModule.cpp
index c4798ff3acc..f0f3dbcce4a 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/tools/lto/LTOModule.cpp
@@ -64,15 +64,10 @@ bool LTOModule::isBitcodeFileForTarget(const char *path,
// Takes ownership of buffer.
bool LTOModule::isTargetMatch(MemoryBuffer *buffer, const char *triplePrefix) {
- OwningPtr<Module> m(getLazyBitcodeModule(buffer, getGlobalContext()));
- // On success, m owns buffer and both are deleted at end of this method.
- if (!m) {
- delete buffer;
- return false;
- }
- std::string actualTarget = m->getTargetTriple();
- return (strncmp(actualTarget.c_str(), triplePrefix,
- strlen(triplePrefix)) == 0);
+ std::string Triple = getBitcodeTargetTriple(buffer, getGlobalContext());
+ delete buffer;
+ return (strncmp(Triple.c_str(), triplePrefix,
+ strlen(triplePrefix)) == 0);
}
OpenPOWER on IntegriCloud