Fix prefix comparison from r212308
authorAlp Toker <alp@nuanti.com>
Fri, 4 Jul 2014 02:01:54 +0000 (02:01 +0000)
committerAlp Toker <alp@nuanti.com>
Fri, 4 Jul 2014 02:01:54 +0000 (02:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212310 91177308-0d34-0410-b5e6-96231b3b80d8

lib/LTO/LTOModule.cpp

index bdf3ed563d9c40f6ebf7b6e3c988dd748e6ceba9..961c759e84cf66952a7b5cf8f0cc56d14f239c70 100644 (file)
@@ -70,7 +70,8 @@ bool LTOModule::isBitcodeFile(const char *path) {
 
 bool LTOModule::isBitcodeForTarget(MemoryBuffer *buffer,
                                    StringRef triplePrefix) {
-  return getBitcodeTargetTriple(buffer, getGlobalContext()) == triplePrefix;
+  std::string Triple = getBitcodeTargetTriple(buffer, getGlobalContext());
+  return StringRef(Triple).startswith(triplePrefix);
 }
 
 LTOModule *LTOModule::createFromFile(const char *path, TargetOptions options,